Actualiser src/fr/iutfbleau/papillon/FenetreAjout.java
This commit is contained in:
@@ -8,6 +8,8 @@ public class FenetreAjout extends JFrame implements ActionListener {
|
||||
|
||||
private final JTextField champTitre;
|
||||
private final JTextArea champContenu;
|
||||
private final JTextField rang;
|
||||
private final JTextField theme;
|
||||
private final JButton boutonValider;
|
||||
private final JButton boutonAnnuler;
|
||||
private final Main parent;
|
||||
@@ -19,7 +21,7 @@ public class FenetreAjout extends JFrame implements ActionListener {
|
||||
setSize(350, 250);
|
||||
setResizable(false);
|
||||
|
||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
// Layout principal
|
||||
setLayout(new BorderLayout(10, 10));
|
||||
@@ -33,11 +35,11 @@ public class FenetreAjout extends JFrame implements ActionListener {
|
||||
JLabel lblTitre = new JLabel("Titre :");
|
||||
champTitre = new JTextField(20);
|
||||
c.gridx = 0;
|
||||
c.gridy = 0;
|
||||
c.gridy = 1;
|
||||
c.weightx = 0;
|
||||
centre.add(lblTitre, c);
|
||||
c.gridx = 1;
|
||||
c.gridy = 0;
|
||||
c.gridy = 1;
|
||||
c.weightx = 1;
|
||||
centre.add(champTitre, c);
|
||||
|
||||
@@ -49,15 +51,41 @@ public class FenetreAjout extends JFrame implements ActionListener {
|
||||
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
|
||||
c.gridx = 0;
|
||||
c.gridy = 1;
|
||||
c.gridy = 2;
|
||||
c.weightx = 0;
|
||||
c.fill = GridBagConstraints.BOTH;
|
||||
centre.add(lblContenu, c);
|
||||
c.gridx = 1;
|
||||
c.gridy = 1;
|
||||
c.gridy = 2;
|
||||
c.weightx = 1;
|
||||
c.weighty = 1.0; // prend la hauteur dispo
|
||||
centre.add(scroll, c);
|
||||
|
||||
// Rang
|
||||
JLabel lblrang = new JLabel("Rang :");
|
||||
rang = new JTextField(20);
|
||||
c.gridx = 0;
|
||||
c.gridy = 3;
|
||||
c.weightx = 0;
|
||||
c.weighty = 0.0; // prend la hauteur dispo
|
||||
centre.add(lblrang, c);
|
||||
c.gridx = 1;
|
||||
c.gridy = 3;
|
||||
c.weightx = 1;
|
||||
centre.add(rang, c);
|
||||
|
||||
// theme
|
||||
JLabel lbltheme = new JLabel("Theme :");
|
||||
theme = new JTextField(20);
|
||||
c.gridx = 0;
|
||||
c.gridy = 4;
|
||||
c.weightx = 0;
|
||||
centre.add(lbltheme, c);
|
||||
c.gridx = 1;
|
||||
c.gridy = 4;
|
||||
c.weightx = 1;
|
||||
centre.add(theme, c);
|
||||
|
||||
// Bas : boutons
|
||||
JPanel bas = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 10));
|
||||
boutonValider = new JButton("Valider");
|
||||
|
||||
Reference in New Issue
Block a user