A source code
jisuanqi2 Package Penalty for;
Import the java.awt *.;
public class Jisuanqi extends Frame{
public Jisuanqi() {
super("计算器");
this.setSize(400,100);
this.setLocation(300,240);
this.setLayout(new FlowLayout());
this.add(new TextField("10",8));
this.add(new Label("+"));
this.add(new TextField("20",8));
this.add(new Button("="));
this.add(new TextField(10));
this.setVisible(true);
}
static void main public (String [] args) {
// the TODO method of automatically generating stubs
new new Jisuanqi ();
}
}
Second, the results
Third, experience
1, there are two groups under JAVA graphical interface control, a group awt, a group is a swing.
Generally used swing
2, java GUI display picture is achieved by setting the icons on the label
3, JCheckBox checkbox to use isSelected to get checked whether