Citation :
package tablespace; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Cadre1 extends JFrame { JPanel contentPane; BorderLayout borderLayout1 = new BorderLayout(); JPanel jpanelhaut = new JPanel(); JTextArea titre = new JTextArea(); JPanel jPanel1 = new JPanel(); JLabel Partie1 = new JLabel(); JTextArea lbltablepace = new JTextArea(); JToggleButton Btvalider = new JToggleButton(); JPanel jPanel2 = new JPanel(); JComboBox Combobox = new JComboBox(); JCheckBox option1 = new JCheckBox(); //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.setLayout(borderLayout1); this.setSize(new Dimension(400, 300)); this.setTitle("Titre du cadre" ); titre.setBackground(SystemColor.scrollbar); titre.setText("Suppression d\'un tablespace" ); titre.setFont(new java.awt.Font("Dialog", 1, 24)); Partie1.setText("Vous avez choisis de supprimer le tablespace" ); Btvalider.setText("OK" ); lbltablepace.setText(" " ); Combobox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { Combobox_actionPerformed(e); } }); option1.setText("Supprimer les utilisateurs associés au tablespace" ); contentPane.add(jpanelhaut, BorderLayout.NORTH); jpanelhaut.add(titre, null); contentPane.add(jPanel1, BorderLayout.SOUTH); jPanel1.add(Partie1, null); jPanel1.add(lbltablepace, null); jPanel1.add(Btvalider, null); contentPane.add(jPanel2, BorderLayout.CENTER); jPanel2.add(Combobox, null); jPanel2.add(option1, null); } //Remplacé, 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 Combobox_actionPerformed(ActionEvent e) { } }
|