package nestedlayouts;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
public class Cadre1 extends JFrame {
JPanel contentPane;
XYLayout xYLayout1 = new XYLayout();
JPanel haut = new JPanel();
JPanel milieu = new JPanel();
JPanel barreétat = new JPanel();
XYLayout xYLayout2 = new XYLayout();
JPanel barreoutils_gauche = new JPanel();
JPanel barreoutils_droite = new JPanel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
GridLayout gridLayout1 = new GridLayout();
GridLayout gridLayout2 = new GridLayout();
JTextField jTextField1 = new JTextField();
XYLayout xYLayout3 = new XYLayout();
JTextArea jTextArea1 = new JTextArea();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
//Construire le cadre
public Cadre1() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Initialiser le composant
private void jbInit() throws Exception {
contentPane = (JPanel) this.getContentPane();
contentPane.setAlignmentY((float) 0.5);
contentPane.setBorder(BorderFactory.createRaisedBevelBorder());
contentPane.setRequestFocusEnabled(true);
contentPane.setLayout(xYLayout1);
this.setSize(new Dimension(636, 401));
this.setTitle("Disposition Imbriqué");
barreétat.setBackground(Color.gray);
barreétat.setBorder(BorderFactory.createRaisedBevelBorder());
milieu.setBackground(Color.gray);
milieu.setBorder(BorderFactory.createRaisedBevelBorder());
milieu.setLayout(xYLayout3);
haut.setBackground(Color.gray);
haut.setBorder(BorderFactory.createRaisedBevelBorder());
haut.setLayout(xYLayout2);
barreoutils_gauche.setBorder(BorderFactory.createRaisedBevelBorder());
barreoutils_gauche.setLayout(gridLayout1);
barreoutils_droite.setBorder(BorderFactory.createRaisedBevelBorder());
barreoutils_droite.setLayout(gridLayout2);
jButton1.setMargin(new Insets(2, 2, 2, 2));
jButton1.setText("OK");
jButton1.addActionListener(new Cadre1_jButton1_actionAdapter(this));
jButton2.setMargin(new Insets(2, 2, 2, 2));
jButton2.setText("Annuler");
jButton3.setMargin(new Insets(2, 2, 2, 2));
jButton3.setText("Aide");
gridLayout1.setHgap(2);
jLabel1.setFont(new java.awt.Font("Dialog", 1, 18));
jLabel1.setForeground(Color.white);
jLabel1.setText("ID_USINE :");
jLabel2.setFont(new java.awt.Font("Dialog", 1, 18));
jLabel2.setForeground(Color.white);
jLabel2.setText("NOM USINE :");
jTextField1.setText("");
jTextField1.addActionListener(new Cadre1_jTextField1_actionAdapter(this));
jTextArea1.setText("");
contentPane.add(haut, new XYConstraints(15, 7, 597, 54));
haut.add(barreoutils_gauche, new XYConstraints(6, 6, 466, 40));
barreoutils_gauche.add(jButton1, null);
barreoutils_gauche.add(jButton2, null);
haut.add(barreoutils_droite, new XYConstraints(503, 6, 85, 40));
barreoutils_droite.add(jButton3, null);
contentPane.add(milieu, new XYConstraints(15, 77, 600, 256));
milieu.add(jTextField1, new XYConstraints(200, 14, 376, 53));
milieu.add(jTextArea1, new XYConstraints(200, 108, 376, 51));
milieu.add(jLabel1, new XYConstraints(34, 24, 117, 45));
milieu.add(jLabel2, new XYConstraints(29, 105, -1, 52));
contentPane.add(barreétat, new XYConstraints(13, 347, 604, 44));
}
//Redéfini, ainsi nous pouvons sortir quand la fenêtre est fermée
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
void jTextField1_actionPerformed(ActionEvent e) {
}
void jButton1_actionPerformed(ActionEvent e) {
}
}
class Cadre1_jTextField1_actionAdapter implements java.awt.event.ActionListener {
Cadre1 adaptee;
Cadre1_jTextField1_actionAdapter(Cadre1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jTextField1_actionPerformed(e);
}
}
class Cadre1_jButton1_actionAdapter implements java.awt.event.ActionListener {
Cadre1 adaptee;
Cadre1_jButton1_actionAdapter(Cadre1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
Partager