|
|
|
@ -11,7 +11,6 @@ public class Computer extends JFrame{
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
Computer t = new Computer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Computer() {
|
|
|
|
|
this.setTitle("计算器");
|
|
|
|
|
Container c = getContentPane();
|
|
|
|
@ -38,7 +37,6 @@ public class Computer extends JFrame{
|
|
|
|
|
aJButtons[13]=new JButton("/");
|
|
|
|
|
aJButtons[14]=new JButton("=");
|
|
|
|
|
aJButtons[15]=new JButton(".");
|
|
|
|
|
|
|
|
|
|
aj.add(aJButtons[7]);
|
|
|
|
|
aj.add(aJButtons[8]);
|
|
|
|
|
aj.add(aJButtons[9]);
|
|
|
|
@ -58,7 +56,6 @@ public class Computer extends JFrame{
|
|
|
|
|
c.add(aj, BorderLayout.CENTER);
|
|
|
|
|
setSize(400, 400);
|
|
|
|
|
setVisible(true);
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < 10; i++) {
|
|
|
|
|
final String o = aJButtons[i].getActionCommand();
|
|
|
|
|
aJButtons[i].addActionListener(new ActionListener() {
|
|
|
|
|