1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
| import java.awt.*;
import javax.swing.*;
public class Fenetre extends JFrame {
private JPanel jContentPane = null;
private JPanel jPanel1 = null;
private JPanel jPanel = null;
private JPanel jPanel2 = null;
private JButton jButton = null;
private JButton jButton2 = null;
private JButton jButton4 = null;
/**
* This is the default constructor
*/
public Fenetre() {
super();
initialize();
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(300, 200);
this.setContentPane(getJContentPane());
this.setTitle("JFrame");
this.setVisible(true);
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(new BorderLayout());
jContentPane.add(getJPanel1(), java.awt.BorderLayout.SOUTH);
jContentPane.add(getJPanel(), java.awt.BorderLayout.NORTH);
jContentPane.add(getJPanel2(), java.awt.BorderLayout.CENTER);
}
return jContentPane;
}
/**
* This method initializes jPanel1
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel1() {
if (jPanel1 == null) {
jPanel1 = new JPanel();
jPanel1.setLayout(new FlowLayout());
jPanel1.add(getJButton(), null);
}
return jPanel1;
}
/**
* This method initializes jPanel
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel() {
if (jPanel == null) {
jPanel = new JPanel();
jPanel.setLayout(new FlowLayout());
jPanel.add(getJButton2(), null);
}
return jPanel;
}
/**
* This method initializes jPanel2
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel2() {
if (jPanel2 == null) {
jPanel2 = new JPanel();
jPanel2.setLayout(null);
jPanel2.add(getJButton4(), null);
}
return jPanel2;
}
/**
* This method initializes jButton
*
* @return javax.swing.JButton
*/
private JButton getJButton() {
if (jButton == null) {
jButton = new JButton("test");
}
return jButton;
}
/**
* This method initializes jButton2
*
* @return javax.swing.JButton
*/
private JButton getJButton2() {
if (jButton2 == null) {
jButton2 = new JButton("test");
}
return jButton2;
}
/**
* This method initializes jButton4
*
* @return javax.swing.JButton
*/
private JButton getJButton4() {
if (jButton4 == null) {
jButton4 = new JButton("test");
jButton4.setBounds(new java.awt.Rectangle(45,35,66,25));
}
return jButton4;
}
} |
Partager