티스토리 뷰
public class BoxLayoutTest extends JFrame {
public BoxLayoutTest() {
super("Box Layout Test example");
JRadioButton r1, r2;
setLayout(new BorderLayout());
Box left = Box.createVerticalBox();
left.add(Box.createVerticalStrut(30));
ButtonGroup radioGroup = new ButtonGroup();
radioGroup.add(r1 = new JRadioButton("야구"));
left.add(r1);
left.add(Box.createVerticalStrut(30));
radioGroup.add(r2 = new JRadioButton("축구"));
left.add(r2);
JPanel leftPanel = new JPanel(new BorderLayout());
leftPanel.setBorder(new TitledBorder(new EtchedBorder(),"스포츠"));
leftPanel.add(left,BorderLayout.CENTER);
Box right = Box.createVerticalBox();
right.add(Box.createVerticalStrut(30));
right.add(new JCheckBox("C언어"));
right.add(Box.createVerticalStrut(30));
right.add(new JCheckBox("Java"));
right.add(Box.createVerticalStrut(30));
right.add(new JCheckBox("C#"));
right.add(Box.createVerticalStrut(30));
right.add(new JCheckBox("Phython"));
JPanel rightPanel = new JPanel(new BorderLayout());
rightPanel.setBorder(new TitledBorder(new EtchedBorder(),"프로그래밍 언어"));
rightPanel.add(right,BorderLayout.CENTER);
Box center = Box.createHorizontalBox();
center.add(leftPanel);
center.add(rightPanel);
add(center, BorderLayout.CENTER);
setSize(300,300);
setVisible(true);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
BoxLayoutTest box = new BoxLayoutTest();
box.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
}
'java,web study > 3주차 (7월 15일 ~21일)' 카테고리의 다른 글
JTable 02 (0) | 2013.07.17 |
---|---|
JTable (0) | 2013.07.17 |
JComboBox (0) | 2013.07.17 |
JTextField, JPasswordField, JTextArea (0) | 2013.07.17 |
JFrame (0) | 2013.07.17 |
- Total
- Today
- Yesterday
- 이론
- 청주
- jsp
- 자바스크립트
- 도전과제
- 알고리즘
- 자바
- SQL
- JQuery
- 배열
- db
- 잡담
- 아두이노
- 프로젝트
- 게임
- HTML
- 정렬
- 오라클
- 정보
- 충북대
- 소켓
- 파이썬
- 클래스
- ERP
- 메모장
- 안드로이드
- 졸업작품
- 데이터베이스
- SVN
- CSS
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |