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
|
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class SimpleFenetre extends JFrame {
/** *. */
private JPanel pan;
/** *. */
private JButton entrer = new JButton("entrer");
/** *. */
private GridBagLayout gridbag = new GridBagLayout();
/** *. */
private GridBagConstraints c = new GridBagConstraints();
public SimpleFenetre() {
this.setResizable(false);
this.setSize(420, 420);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pan = new JPanel();
pan.setSize(320, 320);
pan.setPreferredSize(new Dimension(320, 320));
pan.setMaximumSize(new Dimension(320, 320));
pan.setMinimumSize(new Dimension(320, 320));
pan.setBorder(BorderFactory.createTitledBorder("ulysse031"));
pan.setLayout(null);
pan.add(entrer);
entrer.setBounds(50, 10, 70, 30);
getContentPane().add(pan);
}
/** *. */
public static void main(String[] inArgs) {
SimpleFenetre fenetre = new SimpleFenetre();
fenetre.setVisible(true);
}
} |
Partager