Java 8일차 CheckBox 테스트

import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class CheckBoxTest extends JFrame
{
JPanel panel;
JLabel label;
JCheckBox height, weigth;

public CheckBoxTest()
{
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(300, 200);
this.setVisible(true);

panel = new JPanel();
label = new JLabel("체격 : ");
height = new JCheckBox("175cm 이상");
weigth = new JCheckBox("65kg 이상");

panel.add(label);
panel.add(height);
panel.add(weigth);

add(panel);
}

public static void main(String[] args)
{
new CheckBoxTest();
}
}

result)


댓글 없음: