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
| public static void main() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame frame = new JFrame();
SelectCourb inst = new SelectCourb();
frame.getContentPane().add(inst);
((JComponent)frame.getContentPane()).setPreferredSize(inst.getSize());
frame.pack();
frame.setVisible(true);
System.out.println("Test");
}
});
}
public SelectCourb() {
super();
initGUI();
}
private void initGUI() {
try {
GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
getContentPane().setLayout(thisLayout);
setSize(new Dimension(400, 300));
{
jButton1 = new JButton();
jButton1.setText("Valider");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
frame.dispose();
}
});
}
................................... |
Partager