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
|
private void build3(){
setTitle("Royal Div'x : Ajouter un film");
setSize(600,500);
setLocationRelativeTo(null);
setResizable(false);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//On définit le Grid
monPanel.setLayout(new GridBagLayout());
//On place les label
gbc.fill = GridBagConstraints.BOTH;
gbc.insets = new Insets (10,10,10,10);
gbc.gridx = 1;
gbc.gridy = 4;
monPanel.add(label_bienvenue,gbc);
gbc.gridx = 0;
gbc.gridy = 6;
gbc.gridwidth = 1;
monPanel.add(titre_film,gbc);
gbc.gridx = 0;
gbc.gridy = 7;
monPanel.add(duree_film,gbc);
gbc.gridx = 0;
gbc.gridy = 8;
monPanel.add(synopsis,gbc);
gbc.gridx = 0;
gbc.gridy = 9;
monPanel.add(annee_film,gbc);
gbc.gridx = 0;
gbc.gridy = 10;
monPanel.add(genre_film,gbc);
gbc.gridx = 0;
gbc.gridy = 11;
monPanel.add(realisateur_film,gbc);
gbc.gridx = 0;
gbc.gridy = 12;
monPanel.add(acteur_film,gbc);
gbc.gridx = 0;
gbc.gridy = 13;
monPanel.add(origine_film,gbc);
//On place les JTextFied
gbc.gridx = 1;
gbc.gridy = 6;
gbc.weightx=50;
gbc.gridwidth = 1;
monPanel.add(titreField,gbc); //Titre
gbc.gridx = 1;
gbc.gridy = 7;
monPanel.add(dureeField2,gbc); //Durée en min
gbc.gridx = 1;
gbc.gridy = 8;
monPanel.add(scrollPane,gbc); //Zone de texte pour le synopsis, je récup le
//scrollPane qui lui meme récup mon JTextArea synopsisArea
//On place les JComboBox
gbc.gridx = 1;
gbc.gridy = 9;
monPanel.add(anneeCombo,gbc); //Annee
gbc.gridx = 1;
gbc.gridy = 10;
monPanel.add(genreCombo,gbc); //Genre
gbc.gridx = 1;
gbc.gridy = 11;
monPanel.add(realisateurCombo,gbc); //Réalisateur
gbc.gridx = 1;
gbc.gridy = 12;
monPanel.add(acteurCombo,gbc); //Acteur Principal
gbc.gridx = 1;
gbc.gridy = 13;
monPanel.add(origineCombo,gbc); //Origine
//On place les JButton
gbc.gridx = 2;
gbc.gridy = 12;
gbc.gridwidth = GridBagConstraints.REMAINDER;
monPanel.add(validerBouton,gbc);
gbc.gridx = 2;
gbc.gridy = 13;
gbc.gridwidth = GridBagConstraints.REMAINDER;
monPanel.add(annulerBouton,gbc);
// On attache monPanel
this.getContentPane().add(monPanel);
this.getContentPane().setBackground(Color.blue);
} |
Partager