salut
il faut que j'établisse mon interface graphique, et j'ai besoin d'avoir une idée sur des interfaces en swing "réussies" afin de m'inspirer pour réussir la mienne!!
besoin de votre aide!!
Bonne journée :)
Version imprimable
salut
il faut que j'établisse mon interface graphique, et j'ai besoin d'avoir une idée sur des interfaces en swing "réussies" afin de m'inspirer pour réussir la mienne!!
besoin de votre aide!!
Bonne journée :)
Bonsoir,
Tape interface swing dans google image :p.
Mais vu que swing et basique au niveau visuel graphique pour avoir une interface swing intéressante sur le point design il faut penser à redéfinir les panel et jouer sur de belle images.
sinon d'un point de vu ergonomique sa dépend surtout des utilisateurs ciblé par ton application.
Bonjour, :)
oui c'est très basique, j'ai déjà beaucoup cherché! :((((
mon interface est destinée à des bibliothécaires pour la gestion d'une bibliothèque!! et elle comporte plusieurs volets!!
je pensais trouver par exemple interfaces du genre, pour voir un peu la conception de la gui choisie(onglets/menu à côté ...)
P.S: quand j'ai tapé "gui choisie...", j'ai pensé à la tapé sur google, et ça a donné plus de choix :D
MAIS, je poursuis toujours ma recherche :D
Destiné à des bibliothécaires va falloir faire soft :p.
Tu peux regarder du côté des JTabbedPane, c'est pour faire des onglets. Tiens un cadeau ^_^. C'est une application pour la gestion de location de dvd. Elle est lié à une base de données donc il faut modifier 2-3 trucs elle ne fonctionnera pas directement.
Je t'ai mis la classe qui contient le JTabbedPane et 2 des onglets, la gestion des clients et celui pour visualiser des infos.
Code:
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 package vue; import javax.swing.*; import java.awt.*; /*** * Vue principale de l'application, les onglets sont placés dessus * @author Fabien * */ public class VueCommercial { private JFrame mainFrame; //les onglets, private JTabbedPane _onglets; private OngletGestionClient _ongGestionClient; private OngletGestionProduit _ongGestionProduit; private OngletVueProduit _ongListeProduit; private OngletBienvenue _ongBienvenue; private OngletVueClient _onCli; /*** * Constructeur de la vue rassemblant les onglets */ public VueCommercial() { //création de la fenetre principal mainFrame = new JFrame("Videotheque"); mainFrame.setIconImage(new ImageIcon("./imagesdecors/video.gif" ).getImage()); mainFrame.setSize(750,490); mainFrame.setResizable(false); //on place la fenêtre au centre de l'écran Dimension ecran = Toolkit.getDefaultToolkit().getScreenSize(); mainFrame.setLocation(new Point((ecran.width-mainFrame.getWidth())/2,(ecran.height-mainFrame.getHeight())/2)); //initialisation des onglets _onglets = new JTabbedPane(); _ongGestionClient = new OngletGestionClient(); _ongGestionProduit = new OngletGestionProduit(); _ongListeProduit = new OngletVueProduit(); _ongBienvenue = new OngletBienvenue(); _onCli = new OngletVueClient(); _onglets.addTab("", new ImageIcon("./imagesdecors/accueil.jpg"), _ongBienvenue, "Bienvenue"); _onglets.addTab("Gestion Client", new ImageIcon("./imagesdecors/ajout.jpg"), _ongGestionClient, "ajouter un Livre"); _onglets.addTab("Vue client", new ImageIcon("./imagesdecors/modif.jpg"), _onCli, "Vue des clients"); _onglets.addTab("Gestion Produit", new ImageIcon("./imagesdecors/ajout.jpg"), _ongGestionProduit, "modifier un livret"); _onglets.addTab("Vue Produit", new ImageIcon("./imagesdecors/modif.jpg"), _ongListeProduit, "supprimer un livret"); //ajout des onglets dans la fenetre mainFrame.add(_onglets); //On quitte l'application quand la fenêtre est fermée mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } /*** * Methode d'affichage de la vue */ public void Afficher() { //Affichage de la fenêtre mainFrame.setVisible(true); } public void miseAJour(){ mainFrame.repaint(); } }
onglet Gestion client
Onglet visualiser clientCode:
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335 package vue; import javax.swing.*; import javax.swing.text.MaskFormatter; import modele.ManipCLient; import controleurClient.ControleurAjouterClient; import controleurClient.ControleurListeClient; import controleurClient.ControleurModifierClient; import controleurClient.ControleurRadioClient; import controleurClient.ControleurSupprimerClient; import java.awt.*; import java.text.ParseException; public class OngletGestionClient extends JPanel { /** * */ private static final long serialVersionUID = 1L; private JLabel nom; private JTextField s_nom; private JLabel prenom; private JTextField s_prenom; private JLabel mdp; private JTextField s_mdp; private JLabel age; private JFormattedTextField s_age; private JLabel sexe; private JComboBox s_sexe; private JLabel telephone; private JFormattedTextField s_telephone; private JLabel adresseMail; private JTextField s_adresseMail; private JLabel ville; private JTextField s_ville; private JLabel codePostale; private JFormattedTextField s_codePostale; private JLabel commentaire; private JTextArea s_commentaire; private JButton ajouter; private JButton modifier; private JButton supprimer; private JRadioButton choixAjout; private JRadioButton choixAutre; private ButtonGroup bgroup; private ControleurListeClient clientControle; JComboBox client; /** * Constructeur de la vue cliente */ public OngletGestionClient(){ this.setLayout(new BorderLayout()); //***************** //panel de choix //***************** MonPanel pChoix = new MonPanel(); GridLayout grid = new GridLayout(10,2); grid.setVgap(10); pChoix.setLayout(grid); nom = new JLabel("Nom : ", SwingConstants.CENTER); s_nom = new JTextField(8); s_nom.setAlignmentX(LEFT_ALIGNMENT); prenom = new JLabel("Prenom : ", SwingConstants.CENTER); s_prenom = new JTextField(8); mdp = new JLabel("Mot de passe : ", SwingConstants.CENTER); s_mdp= new JTextField(8); MaskFormatter date = null; try { date = new MaskFormatter("## / ## / ####"); } catch (ParseException e) { e.printStackTrace(); } age = new JLabel("Date de naissance : ", SwingConstants.CENTER); s_age = new JFormattedTextField(date); sexe = new JLabel("Sexe : ", SwingConstants.CENTER); s_sexe = new JComboBox(); s_sexe.addItem("H"); s_sexe.addItem("F"); MaskFormatter tel = null; try { tel = new MaskFormatter("0#-##-##-##-##"); } catch (ParseException e) { e.printStackTrace(); } telephone = new JLabel("Telephone : ",SwingConstants.CENTER); s_telephone = new JFormattedTextField (tel); JPanel panTel = new JPanel(); panTel.add(s_telephone); adresseMail = new JLabel("Mail : ", SwingConstants.CENTER); s_adresseMail = new JTextField(8); ville = new JLabel("Ville : ", SwingConstants.CENTER); s_ville = new JTextField(); MaskFormatter codePost = null; try { codePost = new MaskFormatter("## ###"); } catch (ParseException e) { e.printStackTrace(); } codePostale = new JLabel("Code Postale : ", SwingConstants.CENTER); s_codePostale = new JFormattedTextField(codePost); commentaire = new JLabel("Adresse : ", SwingConstants.CENTER); commentaire.setForeground(Color.BLACK); s_commentaire = new JTextArea(30,30); s_commentaire.setPreferredSize(new Dimension(200,100)); pChoix.add(nom); pChoix.add(s_nom); pChoix.add(prenom); pChoix.add(s_prenom); pChoix.add(mdp); pChoix.add(s_mdp); pChoix.add(age); pChoix.add(s_age); pChoix.add(sexe); pChoix.add(s_sexe); pChoix.add(telephone); pChoix.add(s_telephone); pChoix.add(adresseMail); pChoix.add(s_adresseMail); pChoix.add(ville); pChoix.add(s_ville); pChoix.add(codePostale); pChoix.add(s_codePostale); pChoix.add(commentaire); pChoix.add(s_commentaire); //********************* // le panel des commandes //********************** JPanel panCommande = new JPanel(); JPanel pBoutons = new JPanel(); pBoutons.setLayout(new GridLayout(10,2)); //******************* // les radios button //******************* ControleurRadioClient controleRadio = new ControleurRadioClient(this); choixAjout = new JRadioButton("Ajout",true); choixAjout.addActionListener(controleRadio); choixAutre = new JRadioButton("Client",false); choixAutre.addActionListener(controleRadio); bgroup = new ButtonGroup(); bgroup.add(choixAjout); bgroup.add(choixAutre); //************** // Les boutons //************** ControleurAjouterClient controlAjout = new ControleurAjouterClient(this); ajouter = new JButton("Ajouter"); ajouter.addActionListener(controlAjout); client = new JComboBox(ManipCLient.lister_tout_client()); clientControle = new ControleurListeClient(this); client.addItemListener(clientControle); client.setEnabled(false); ControleurModifierClient controlModif= new ControleurModifierClient(this); modifier = new JButton("Modifier"); modifier.addActionListener(controlModif); modifier.setEnabled(false); ControleurSupprimerClient controlSupp= new ControleurSupprimerClient(this); supprimer = new JButton("Supprimer"); supprimer.addActionListener(controlSupp); supprimer.setEnabled(false); pBoutons.add(choixAjout); pBoutons.add(ajouter); pBoutons.add(new JLabel("")); pBoutons.add(new JLabel("")); pBoutons.add(choixAutre); pBoutons.add(client); pBoutons.add(new JLabel("")); pBoutons.add(new JLabel("")); pBoutons.add(new JLabel("")); pBoutons.add(modifier); pBoutons.add(new JLabel("")); pBoutons.add(new JLabel("")); pBoutons.add(new JLabel("")); pBoutons.add(supprimer); pBoutons.add(new JLabel("")); pBoutons.add(new JLabel("")); panCommande.add(pBoutons); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,null, panCommande); splitPane.setOneTouchExpandable(false); splitPane.setBackground(Color.BLACK); splitPane.setResizeWeight(0.8); //************************* // Ajout dans la fenetre //************************* add(pChoix, BorderLayout.CENTER); add(splitPane, BorderLayout.EAST); } public JFormattedTextField getCodePostal() { return s_codePostale; } public JTextField getTelephone() { return s_telephone; } public JTextArea getAdresse() { return s_commentaire; } public JTextField getMail() { return s_adresseMail; } public JTextField getMdp() { return s_mdp; } public JTextField getS_nom() { return s_nom; } public JLabel getprenom() { return prenom; } public JTextField getS_prenom() { return s_prenom; } public JLabel getAge() { return age; } public JFormattedTextField getS_Age() { return s_age; } public JLabel getSexe() { return sexe; } public JComboBox getS_sexe() { return s_sexe; } public JLabel getville() { return ville; } public JTextField getS_ville() { return s_ville; } public JLabel getCommentaire() { return commentaire; } public JTextArea getS_commentaire() { return s_commentaire; } public JButton getAjouter() { return ajouter; } public JButton getModifier() { return modifier; } public JButton getSupprimer() { return supprimer; } public JRadioButton getChoixAjout() { return choixAjout; } public JRadioButton getChoixAutre() { return choixAutre; } public ButtonGroup getBgroup() { return bgroup; } public JComboBox getClient() { return client; } public ControleurListeClient getControleClient(){ return clientControle; } }
Main de l'applicationCode:
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 package vue; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSplitPane; public class OngletVueClient extends JPanel{ /** * */ private static final long serialVersionUID = 1L; private Liste pan; private JLabel titre; private JLabel lab; private JLabel lab2; private JLabel lab3; private JLabel lab4; private JLabel lab5; private JLabel lab6; public OngletVueClient(){ this.setLayout(new BorderLayout()); //************** // la liste //************** pan = new Liste(this); //********************** // les infos disponible //********************** JPanel panInfo = new JPanel(); panInfo.setLayout(new GridLayout(10,1)); panInfo.setPreferredSize(new Dimension(300,300)); titre = new JLabel(""); lab = new JLabel(" - Nombre de location : /"); lab2 = new JLabel(" - Location en cours : /"); lab3 = new JLabel(" - Téléphone : /"); lab4 = new JLabel(" - Mail : /"); lab5 = new JLabel(" - Ville : /"); lab6 = new JLabel(" - Adresse : /"); panInfo.add(titre); panInfo.add(lab); panInfo.add(lab2); panInfo.add(lab3); panInfo.add(lab4); panInfo.add(lab5); panInfo.add(lab6); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,null,panInfo); splitPane.setOneTouchExpandable(false); splitPane.setDividerSize(10); splitPane.setBackground(Color.lightGray); splitPane.setResizeWeight(0.8); this.add(pan,BorderLayout.CENTER); this.add(splitPane,BorderLayout.EAST); } public JLabel getLab(){ return lab; } public JLabel getLab2(){ return lab2; } public JLabel getLab3(){ return lab3; } public JLabel getLab4(){ return lab4; } public JLabel getLab5(){ return lab5; } public JLabel getLab6(){ return lab6; } public JLabel gettitre(){ return titre; } public Liste getListe(){ return pan; } }
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package application; import vue.VueCommercial; public class AppliCommercial{ /*** * Main de l'application administrateur * @param args */ public static void main(String[] args) { VueCommercial dvd= new VueCommercial(); dvd.Afficher(); } }
Bonjour,
Merci de ta réponse, c'est sympa
effectivement, j'ai eu recours à des panels
pour ton interface, elle est bien organisée et claire, mm si j'ai pris un peu de temps pourhhhhCitation:
modifier 2-3 trucs
sinon, il m'est avéré que la plupart des interfaces java sont très simples, alors que moi je cherche l'introuvable!!!
de toute façon, je n'ai qu'à compter sur mon imagination :P
merci encore une fois!!