์ „์ฒด ๊ธ€ 395

[JAVA / SWING] ๋ฐฐ์น˜๊ด€๋ฆฌ์ž(Layout Manager) - FlowLayout

import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; public class FlowLayoutEx extends JFrame { public FlowLayoutEx (){ setLayout(new FlowLayout()); //ํ”„๋ ˆ์ž„ ๋ฐฐ์น˜๊ด€๋ฆฌ์ž setTitle("FlowLayout ์ž…๋‹ˆ๋‹ค"); setSize(300, 300); setLocationRelativeTo(null); //ํ™”๋ฉด ์ค‘์•™์— ์ƒ์„ฑ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); JButton bt1 = new JButton("๋ฒ„ํŠผ1"); JButton bt2 = new J..

ํ˜•๋ณ€ํ™˜(Casting) Ex1

class Car{ String color; int door; void drive(){ System.out.println("๋ถ€๋ฆ‰๋ถ€๋ฆ‰!"); } void stop(){ System.out.println("์ •์ง€ํ•ฉ๋‹ˆ๋‹ค!"); } }//end of Car class class FireEngine extends Car{ void water(){ System.out.println("๋ฌผ์„ ๋ฟŒ๋ฆฝ๋‹ˆ๋‹ค!"); } }//end of FireEngine class public class CastingTest1 { public static void main(String[] args) { Car car = null; FireEngine fe = new FireEngine(); FireEngine fe2 = null; fe.wat..

์ž๋ฐ” ํŒจ์Šค ์„ค์ •ํ•˜๊ธฐ

1. ์ปดํ“จํ„ฐ -> ์†์„ฑ 2. ๊ณ ๊ธ‰์‹œ์Šคํ…œ ์„ค์ • 3. ๊ณ ๊ธ‰ํƒญ -> ํ™˜๊ฒฝ๋ณ€์ˆ˜ 4. JAVA_HOME ์„ค์ •->์ƒˆ๋กœ๋งŒ๋“ค๊ธฐ 4. JAVA_HOME ์„ค์ •-๋ณ€์ˆ˜์ด๋ฆ„ : JAVA_HOME-๋ณ€์ˆ˜๊ฐ’ : C:\Program Files\Java\jdk1.8.0_101->ํ™•์ธ 5. PATH ์„ค์ •์‹œ์Šคํ…œ ๋ณ€์ˆ˜ -> Path -> ํŽธ์ง‘ 5. PATH ์„ค์ •-๋ณ€์ˆ˜ ๊ฐ’ : C:\Program Files\Java\jdk1.8.0_101\bin;->ํ™•์ธ(๊ธฐ์กด์˜ ๋‚ด์šฉ์— ์ถ”๊ฐ€ํ•œ๋‹ค) 6. CLASSPATH ์„ค์ •->์ƒˆ๋กœ๋งŒ๋“ค๊ธฐ 6. CLASSPATH ์„ค์ • -๋ณ€์ˆ˜ ์ด๋ฆ„ : CLASSPATH-๋ณ€์ˆ˜ ๊ฐ’ : %JAVA_HOME%\lib\tools.jar;->ํ™•์ธ 7. ํ…Œ์ŠคํŠธcmd -> java OK 7. Testcmd -> javac OK