Codigo de calculadora en java

Páginas: 4 (814 palabras) Publicado: 17 de marzo de 2012
// CALCULADORA CREADA POR: GENARO ALOMIA GARZON // E-MAIL GALOMIA@GMAIL.COM // DERECHOS RESERVADOS DE AUTOR // TAREA DE PROGRAMACION EN JAVA // SERVICIO NACIONAL DE APRTENDIZAJE import java.awt.*;import java.applet.*; import java.awt.event.*; // public class AppletCalculadora extends Applet implements ActionListener { Button b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15,b16, b17, b18; TextField t1; Panel p1, p2, p3; int sn1, sn2,suma,rn1,rn2,resta,mn1,mn2,multiplicacion,dn1,dn2,division; int dpd,sb,rb,mb,db,btn0; doublesn1d,sn2d,sumad,rn1d,rn2d,restad,mn1d,mn2d,multiplicaciond,dn1d,dn2d,divisiond;

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....
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Codigo java para una calculadora
  • Calculadora Java
  • Java Calculadora
  • Calculadora java
  • Calculadora (java)
  • Calculadora En Java
  • Calculadora java
  • Codigos de java

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS