El guevo peluo

Solo disponible en BuenasTareas
  • Páginas : 2 (458 palabras )
  • Descarga(s) : 0
  • Publicado : 30 de marzo de 2011
Leer documento completo
Vista previa del texto
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class EjemploSwing2 extends JFrame {
static JButton b1,b2,b3,b4,b5;
static JTextField t1,t2,t3,t4,t5,t6,t7,t8;public EjemploSwing2(){
initComponents();
}
public void initComponents(){
setLayout(null);
JLabel l1 = new JLabel ("Operaciones");
l1.setBounds(180,10,100,10);JLabel l2 = new JLabel ("A");
l2.setBounds(80,50,100,10);
JLabel l3 = new JLabel ("B");
l3.setBounds(80,90,100,10);
JLabel l4 = new JLabel ("Total");l4.setBounds(80,130,100,10);
JLabel l5 = new JLabel ("Introduzca valores");
L5.setBounds(80,170,100,10);
JLabel l6 = new JLabel ("R1");
L6.setBounds(290,180,50,30);
JLabel l7 = new JLabel ("R2");L7.setBounds(290,230,50,30);
t1 = new JTextField ();
t1.setBounds(150,40,50,30);
t2 = new JTextField ();
t2.setBounds(150,80,50,30);
t3 = new JTextField ();t3.setBounds(150,120,50,30);
t4 = new JTextField ();
t4.setBounds(80,210,100,10);
t5 = new JTextField ();
t5.setBounds(150,210,50,30);
t6 = new JTextField ();t6.setBounds(220,210,50,30);
t7 = new JTextField ();
t7.setBounds(360,190,50,30);
t8 = new JTextField ();
t8.setBounds(360,230,50,30);
b1 = new JButton("+");
b1.setBounds(280,30,50,30);b2 = new JButton("-");
b2.setBounds(280,70,50,30);
b3 = new JButton("*");
b3.setBounds(280,110,50,30);
b4 = new JButton("/");
b4.setBounds(280,150,50,30);
b5 = newJButton(" OK ");
b5.setBounds(290,210,50,30);
this.setSize(400,300);
this.setVisible(true);
add(l1);
add(l2);
add(l3);
add(l4);
add(t1);
add(t2);
add(t3);add(b1);
add(b2);
add(b3);
add(b4);
b1.addActionListener(new evento(this));
b2.addActionListener(new evento(this));
b3.addActionListener(new evento(this));...
tracking img