MapleStory Finger Point Cute Line Smiley Blinking Hello Kitty Angel MapleStory Finger Point

πŸ’Ž JAVA/πŸ“šλͺ…ν’ˆ JAVA_ESSENTIAL

Λšβ‚Šβœ©β€§β‚Š [λͺ…ν’ˆ JAVA ESSENTIAL] CH8 μ—°μŠ΅λ¬Έμ œ&이둠문제 Λšβ‚Šβœ©β€§β‚Š

HYEJU01 2022. 4. 17. 16:51
"κ°œμ •νŒ: λͺ…ν’ˆ JAVAESSENTIAL(ν™©κΈ°νƒœ)"κ΅μž¬μ— 수둝된 λ¬Έμ œλ“€μ„ ν’€μ–΄μ„œ μ˜¬λ¦½λ‹ˆλ‹€.
문제의 번호만 ν‘œκΈ°ν•˜κ³  λ‹΅μ•ˆλ§Œ μ λŠ” ν˜•νƒœλ‘œ μ—…λ‘œλ“œ ν•˜κ³ μžˆμŠ΅λ‹ˆλ‹€.
개인 ν’€μ΄μ΄λ―€λ‘œ μ˜€λ‹΅μ΄ μžˆμ„ 수 있으며 μ˜€λ‹΅ 발견 μ‹œ λŒ“κΈ€ λ‚¨κ²¨μ£Όμ‹œλ©΄ κ°μ‚¬ν•˜κ² μŠ΅λ‹ˆλ‹€πŸ˜Š
-
#이 ν‘œμ‹œλœ 건 아직 풀지 λͺ»ν•œ 문제 or ν—·κ°ˆλ¦¬λŠ” λ¬Έμ œμž…λ‹ˆλ‹€!
좔후에 λ‹€μ‹œ ν’€μ–΄μ„œ 올릴 μ˜ˆμ •μ΄μ—μš”!

-ujeyhx-

βœ…Check Time 333p 

 

1) μ΅œμƒμœ„ μ»¨ν…Œμ΄λ„ˆκ°€ μ•„λ‹Œ 것은 ? 

λ‹΅ : JPanel

JPanel 은 λ…λ¦°μ μœΌλ‘œ μ‘΄μž¬ν•  수 μ—†λ‹€. λ‹€λ₯Έ μ»¨ν…Œμ΄λ„ˆμ— λΆ€μ°©λ˜μ–΄μ•Ό 화면에 좜λ ₯λœλ‹€.

 

2) 

JButton btn = new JButton("Hello");
c.add(btn);

 

 

 

βœ…Check Time 345p

 

1) μ»¨ν…Œμ΄λ„ˆλŠ” μ»΄ν¬λ„ŒνŠΈλ₯Ό 포함 ν•  수 μžˆλŠ” μ»΄ν¬λ„ŒνŠΈ

μ»΄ν¬λ„ŒνŠΈλŠ” λ‹€λ₯Έ μ»΄ν¬λ„ŒνŠΈλ₯Ό 포함 ν•  수 μ—†λ‹€.

 

2)

c.setLayout(new FlowLayout());

3)

c.setLayout(null); //μ»¨νƒ νŠΈνŒ¬μ˜ λ°°μΉ˜κ΄€λ¦¬μž 제거

4)

λ°°μΉ˜κ΄€λ¦¬μžμ˜ 역할은 μ»΄ν¬λ„ŒνŠΈμ˜ μœ„μΉ˜μ™€ 크기λ₯Ό κ²°μ •ν•œλ‹€.

λ°°μΉ˜κ΄€λ¦¬μžκ°€ 없을 경우, μœ„μΉ˜μ™€ 크기λ₯Ό μ•Œ 수 μ—†κΈ° λ•Œλ¬Έμ— 직접 μ„€μ •ν•΄μ£Όμ–΄μ•Όν•œλ‹€.

 

 

 

 

πŸ”Žμ΄λ‘ λ¬Έμ œ

 

1) μŠ€μœ™ μ»΄ν¬λ„ŒνŠΈ ν΄λž˜μŠ€κ°€ μ•„λ‹Œ 것은?

μŠ€μœ™ μ»΄ν¬λ„ŒνŠΈλŠ” J둜 μ‹œμž‘ν•œλ‹€. 

 

> 1번 : Panel (awt μ»΄ν¬λ„ŒνŠΈ)

 

 

 

2) μ»΄ν¬λ„ŒνŠΈκ°€ μ•„λ‹Œ 것은 ?

 

> 3번 : FONT

 

 

3) 빈칸 μ±„μš°κΈ°λ¬Έμ œ

public class MyFrame extends JFrame {

Container c = getContentPane();
c.add(new JButton("hello");
setSize(200,400);
setVisible(true);

}


public static void main(String[] args) {
	MyFrame frame = new MFrame();
}

 

 

 

4) ν”„λ‘œκ·Έλž¨ μˆ˜μ • 문제

import javax.swing.*;

public class MyFrame extends JFrame {

	public MyFrame() {
    
    setSize(300,300);
    setVisible(true);
    }
    
    public static void main (String[] args){
    JFrame mf = new MyJFrame();
    }

}

 

 

5)

> 2번 : μ»¨ν…Œμ΄λ„ˆλŠ” λ‹€λ₯Έ μ»¨ν…Œμ΄λ„ˆμ— (μ»΄ν¬λ„ŒνŠΈλ‘œ) 포함될 수 μžˆλ‹€.

 

 

 

6) 

> 2번 :  μ»¨ν…Œμ΄λ„ˆλŠ” ν•˜λ‚˜μ˜ λ°°μΉ˜κ΄€λ¦¬μžλ₯Ό κ°–λŠ”λ‹€. 

 

 

7)

1)
c.setLayout(new BorderLayout("10,20"));

2)
c.setLayout(new FlowLayout("10,20"));

3)
c.setLayout(new GridLyout("10,20,2,5"));

 

 

 

8) μ½”λ“œ μ™„μ„±ν•˜κΈ°

 

public MyFrame() {
	Container c = getContentPane(); //μ»¨νƒ νŠΈνŒ¬μ— λŒ€ν•œ 레퍼런슀 μ–»κΈ°
    c.setLayout(null);
    
    JButton b = enw Jbutton("hello");
    
    b.setLocation(30,40);
    b.setSize(100,100);
    c.add(b);
    
    setSize(300,100)
    setVisible(true);
  }