Diagramador

Solo disponible en BuenasTareas
  • Páginas : 3 (703 palabras )
  • Descarga(s) : 0
  • Publicado : 6 de noviembre de 2011
Leer documento completo
Vista previa del texto
ClaseAtributos
package diagramador;

import java.awt.Container;
import java.awt.event.*;
import javax.swing.*;

public class Atributos extends JFrame {

private JButton b1;
privateJCheckBox c1;
private JCheckBox c2;
private JLabel l1;
private JLabel l2;
private JLabel l3;
private JLabel l4;
private JTextField t1;
private JTextField t2;private Panel panel;
Diagramador diagramador;
intnEntidad, nAtributo;

public Atributos() {
initComponents();

}

public Atributos(Diagramador d, int entidad, int atributo) {
nEntidad =entidad;
nAtributo = atributo;
diagramador = d;
initComponents();
}

private void initComponents() {

b1 = new JButton("Agregar");
l1 = new JLabel("Nombre");l2 = new JLabel("Tipo");
l3 = new JLabel("");
t1 = new JTextField(100);
t2 = new JTextField(100);
c1 = new JCheckBox();
c2 = new JCheckBox();
l4= new JLabel("");
GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);b1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEventevt) {
jButton1ActionPerformed(evt);
}
});
setResizable(false);setTitle("CARACTERISTICAS");
setSize(500, 300);
setLocationRelativeTo(null);
Container c = this.getContentPane();
c.setLayout(null);
panel = new Panel(80, 90);
c.add(panel);
panel.add(l1);l1.setBounds(300, 50, 120, 20);
panel.add(t1);
t1.setBounds(350, 50, 120, 20);
panel.add(l2);
l2.setBounds(30, 50, 120, 20);
panel.add(t2);
t2.setBounds(90, 50,120, 20);
panel.add(l3);
l3.setBounds(30, 80, 120, 20);
panel.add(c1);
panel.add(l4);
l4.setBounds(30, 120, 120, 20);
panel.add(c2);
panel.add(b1);
b1.setBounds(180,...
tracking img