Codigo de calculadora en java
public AppletCalculadora () {
p1 = new Panel(new GridLayout(2,1,10,10)); setLayout(new FlowLayout()); p3 = new Panel(new GridLayout(6,3,10,10)); p2 = newPanel(new BorderLayout());
t1 = new TextField(26);
b1 = new Button(" b2 = new Button("2"); b3 = new Button("3"); b4 = new Button("4"); b5 = new Button("5"); b6 = new Button("6"); b7 = newButton("7"); b8 = new Button("8"); b9 = new Button("9");
1
");
b10 = new Button("."); b11 = new Button("0"); b12 = new Button("CE"); b13 = new Button("+"); b14 = new Button("-"); b15 = new Button("=");b16 = new Button("*"); b17 = new Button("/"); b18 = new Button("C");
add(t1); p3.add(b1); p3.add(b2); p3.add(b3); p3.add(b4); p3.add(b5); p3.add(b6);
p3.add(b7); p3.add(b8); p3.add(b9);p3.add(b10); p3.add(b11); p3.add(b12); p3.add(b13); p3.add(b14); p3.add(b15); p3.add(b16); p3.add(b17); p3.add(b18);
add(p1); add(p2); add(p3);
t1. addActionListener(this); b1.addActionListener(this); b2. addActionListener(this); b3. addActionListener(this); b4. addActionListener(this); b5. addActionListener(this); b6. addActionListener(this); b7. addActionListener(this); b8.addActionListener(this);
b9. addActionListener(this); b10. addActionListener(this); b11. addActionListener(this); b12. addActionListener(this); b13. addActionListener(this); b14. addActionListener(this); b15....
Regístrate para leer el documento completo.