Dev_Study/Java_backup 10

[JAVA / SWING] 배치관리자(Layout Manager) - BoxLayout

import java.awt.Component; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class BoxLayoutEx extends JFrame { public BoxLayoutEx (){ setTitle("BoxLayout 입니다"); setSize(300, 300); setLocationRelativeTo(null); //화면 중앙에 생성 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); JPanel jp = new JPanel(); jp.setLayout(ne..

[JAVA / SWING] 배치관리자(Layout Manager) - GridLayout

import java.awt.GridLayout; import javax.swing.JButton; import javax.swing.JFrame; public class GridLayoutEx extends JFrame { public GridLayoutEx (){ setLayout(new GridLayout(0, 4)); //GridLayout(행, 열) setTitle("GridLayout 입니다"); setSize(300, 300); setLocationRelativeTo(null); //화면 중앙에 생성 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); JButton bt1 = new JButton("버튼1"); JButton ..

[JAVA / SWING] 배치관리자(Layout Manager) - BorderLayout

import java.awt.BorderLayout; import javax.swing.JButton; import javax.swing.JFrame; public class BorderLayoutEx extends JFrame { public BorderLayoutEx (){ setLayout(new BorderLayout()); //프레임 배치관리자 setTitle("BorderLayout 입니다"); setSize(300, 300); setLocationRelativeTo(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); JButton bt1 = new JButton("버튼1"); JButton bt2 = new JBu..

[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..

자바 패스 설정하기

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