Bonsoir,
je suis en train de faire une petite IHM comportant 2 onglets comportant chacun des menus déroulants tout compile correctement mais lorsque j'execute j'ai une toute petite fenetre en haut a droite de mon ecran on est obligé d'agrandir pour voir la fenetre et lorsque la fenetre s'agrandit qu'est ce qu'on voit? ben rien du tout un ecran blanc
Si vous pouvez m'aidez je vous remercie
De même si vous avez des critiques(conventions que je ne respecte pas methode mal ecrite )n'hésitez pas.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144 public class IhmAdmin extends Frame implements ActionListener{ /**Liste des menus déroulant pour les diplômes departements promotions années ect...**/ protected JComboBox cadd; protected JComboBox cuser; protected JComboBox csup; protected JComboBox cdept; protected JComboBox cdipl; protected JComboBox cpromo; protected JComboBox cyear; protected JComboBox cmat; protected JComboBox cetu; protected JLabel login; protected JLabel mdp; protected JLabel nature; protected JLabel fonction; protected JButton bmodif; protected JButton bsup; protected JButton bsecr; protected JButton bens; protected JTabbedPane onglet; protected JPanel p1_note; protected JPanel p2_note; protected JPanel p3_note; protected JPanel p1_user; protected JPanel p2_user; protected JPanel jpnote; protected JPanel jpuser; protected JTextArea tlogin; protected JTextArea tmdp; protected JTextArea tnature; protected JTextArea tfonction; /** <p> Constructeur de la classe IhmAdmin: </p> * <p> Placement des boutons des menus déroulant </p> * <p> Création des onglets </p> **/ public IhmAdmin(){ super ("Configuration Administrateur"); //etape 1: initialisation du composant /*Composant du 1er panel de l'onglet*/ bsup=new JButton(" Supprimer "); bsecr= new JButton(" Secretaire "); bens= new JButton(" Enseignant "); cetu=new JComboBox(); cmat=new JComboBox(); cadd=new JComboBox(); csup=new JComboBox(); cyear=new JComboBox(); cdept=new JComboBox(); cdipl=new JComboBox(); cpromo=new JComboBox(); onglet=new JTabbedPane(); p1_note=new JPanel(); p2_note=new JPanel(); p3_note=new JPanel(); jpnote = new JPanel(); jpuser = new JPanel(); /*onglet utilisateur*/ login=new JLabel(); mdp=new JLabel(); nature=new JLabel(); fonction=new JLabel(); bmodif=new JButton(); cuser=new JComboBox(); tlogin=new JTextArea(); tmdp=new JTextArea(); tnature=new JTextArea(); tfonction=new JTextArea(); p1_user=new JPanel(); p2_user=new JPanel(); //etape 2 placement des composants /*placement dans l'onglet Note*/ p1_note.add(cdept); p1_note.add(cdept); p1_note.add(cdipl); p1_note.add(cpromo); p1_note.add(cyear); p1_note.add(cmat); p2_note.add(cetu); p2_note.add(cadd); p2_note.add(csup); p3_note.add(bsecr); p3_note.add(bens); jpnote.add(p1_note); jpnote.add(p2_note); jpnote.add(p3_note); onglet.add("Note",jpnote); onglet.add("Utilisateur",jpuser); /*placement des composants dans l'onglet user*/ p1_user.add(cuser); p1_user.add(bmodif); p2_user.add(login); p2_user.add(mdp); p2_user.add(nature); p2_user.add(fonction); p2_user.add(tlogin); p2_user.add(tmdp); p2_user.add(tnature); p2_user.add(tfonction); jpuser.add(p1_user); jpuser.add(p2_user); onglet.add("Note",jpnote); onglet.add("Utilisateur",jpuser); //etape 3 abonnements //ajout des actions listener A COMPLETER this.addWindowListener(new FermeFenetre()); //visualisation this.setSize(600,800); this.pack(); this.show(); } public void actionPerformed(ActionEvent e){} public static void main (String args[]){ new IhmAdmin(); } class FermeFenetre extends WindowAdapter {//WindowsAdapter implemente WindowListener public void windowClosing(WindowEvent e){ System.exit(0); } } }
Merci beaucoup
Partager