Bladeren bron

barre de statut opérationelle

PCYoshi 9 jaren geleden
bovenliggende
commit
60fb2c86d3

+ 55
- 36
java/.idea/workspace.xml Bestand weergeven

@@ -7,7 +7,8 @@
7 7
   </component>
8 8
   <component name="ChangeListManager">
9 9
     <list default="true" id="a647cb6a-4230-4101-a652-d7cfd0c21e24" name="Default" comment="">
10
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/GestionBddDAO/ConnexionBDD.java" afterPath="$PROJECT_DIR$/src/GestionBddDAO/ConnexionBDD.java" />
10
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/GestionErreurs/BDDException.java" afterPath="$PROJECT_DIR$/src/GestionErreurs/BDDException.java" />
11
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/InterfaceGraphique/InterfacePrincipale.java" afterPath="$PROJECT_DIR$/src/InterfaceGraphique/InterfacePrincipale.java" />
11 12
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
12 13
     </list>
13 14
     <ignored path="java.iws" />
@@ -30,11 +31,11 @@
30 31
   </component>
31 32
   <component name="FileEditorManager">
32 33
     <leaf>
33
-      <file leaf-file-name="InterfacePrincipale.java" pinned="false" current-in-tab="false">
34
+      <file leaf-file-name="InterfacePrincipale.java" pinned="false" current-in-tab="true">
34 35
         <entry file="file://$PROJECT_DIR$/src/InterfaceGraphique/InterfacePrincipale.java">
35 36
           <provider selected="true" editor-type-id="text-editor">
36
-            <state vertical-scroll-proportion="0.0">
37
-              <caret line="425" column="45" selection-start-line="425" selection-start-column="45" selection-end-line="425" selection-end-column="45" />
37
+            <state vertical-scroll-proportion="0.33266932">
38
+              <caret line="361" column="26" selection-start-line="361" selection-start-column="19" selection-end-line="361" selection-end-column="26" />
38 39
               <folding />
39 40
             </state>
40 41
           </provider>
@@ -44,7 +45,7 @@
44 45
         <entry file="file://$PROJECT_DIR$/src/GestionErreurs/BDDException.java">
45 46
           <provider selected="true" editor-type-id="text-editor">
46 47
             <state vertical-scroll-proportion="0.0">
47
-              <caret line="7" column="5" selection-start-line="7" selection-start-column="5" selection-end-line="7" selection-end-column="5" />
48
+              <caret line="8" column="1" selection-start-line="8" selection-start-column="1" selection-end-line="8" selection-end-column="1" />
48 49
               <folding>
49 50
                 <element signature="e#109#110#0" expanded="true" />
50 51
                 <element signature="e#130#131#0" expanded="true" />
@@ -53,16 +54,28 @@
53 54
           </provider>
54 55
         </entry>
55 56
       </file>
56
-      <file leaf-file-name="ConnexionBDD.java" pinned="false" current-in-tab="true">
57
+      <file leaf-file-name="ConnexionBDD.java" pinned="false" current-in-tab="false">
57 58
         <entry file="file://$PROJECT_DIR$/src/GestionBddDAO/ConnexionBDD.java">
58 59
           <provider selected="true" editor-type-id="text-editor">
59
-            <state vertical-scroll-proportion="0.42910448">
60
-              <caret line="107" column="6" selection-start-line="107" selection-start-column="6" selection-end-line="107" selection-end-column="6" />
60
+            <state vertical-scroll-proportion="0.0">
61
+              <caret line="24" column="11" selection-start-line="24" selection-start-column="11" selection-end-line="24" selection-end-column="11" />
61 62
               <folding />
62 63
             </state>
63 64
           </provider>
64 65
         </entry>
65 66
       </file>
67
+      <file leaf-file-name="GestionCategories.java" pinned="false" current-in-tab="false">
68
+        <entry file="file://$PROJECT_DIR$/src/GestionBddDAO/GestionCategories.java">
69
+          <provider selected="true" editor-type-id="text-editor">
70
+            <state vertical-scroll-proportion="0.0">
71
+              <caret line="83" column="44" selection-start-line="83" selection-start-column="44" selection-end-line="83" selection-end-column="44" />
72
+              <folding>
73
+                <element signature="imports" expanded="true" />
74
+              </folding>
75
+            </state>
76
+          </provider>
77
+        </entry>
78
+      </file>
66 79
     </leaf>
67 80
   </component>
68 81
   <component name="FileTemplateManagerImpl">
@@ -110,14 +123,14 @@
110 123
         <option value="$PROJECT_DIR$/src/MainAdminBddBurgerQuizz.java" />
111 124
         <option value="$PROJECT_DIR$/src/GestionBddDAO/ConfigBDD.java" />
112 125
         <option value="$PROJECT_DIR$/src/InterfaceGraphique/BDDException.java" />
113
-        <option value="$PROJECT_DIR$/src/InterfaceGraphique/InterfacePrincipale.java" />
114 126
         <option value="$PROJECT_DIR$/src/BDDException.java" />
115 127
         <option value="$PROJECT_DIR$/src/TOTo.java" />
116
-        <option value="$PROJECT_DIR$/src/GestionErreurs/BDDException.java" />
117 128
         <option value="$PROJECT_DIR$/src/GestionBddDAO/GestionCategories.java" />
118 129
         <option value="$PROJECT_DIR$/src/GestionBddDAO/GestionQuestions.java" />
119 130
         <option value="$PROJECT_DIR$/src/GestionBddDAO/GestionReponses.java" />
120 131
         <option value="$PROJECT_DIR$/src/GestionBddDAO/ConnexionBDD.java" />
132
+        <option value="$PROJECT_DIR$/src/GestionErreurs/BDDException.java" />
133
+        <option value="$PROJECT_DIR$/src/InterfaceGraphique/InterfacePrincipale.java" />
121 134
       </list>
122 135
     </option>
123 136
   </component>
@@ -861,7 +874,13 @@
861 874
       <option name="project" value="LOCAL" />
862 875
       <updated>1433696676178</updated>
863 876
     </task>
864
-    <option name="localTasksCounter" value="31" />
877
+    <task id="LOCAL-00031" summary="f,ekgfnje">
878
+      <created>1433765542215</created>
879
+      <option name="number" value="00031" />
880
+      <option name="project" value="LOCAL" />
881
+      <updated>1433765542215</updated>
882
+    </task>
883
+    <option name="localTasksCounter" value="32" />
865 884
     <servers />
866 885
   </component>
867 886
   <component name="TodoView">
@@ -877,25 +896,25 @@
877 896
     <frame x="-1" y="27" width="1368" height="712" extended-state="6" />
878 897
     <editor active="true" />
879 898
     <layout>
880
-      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
881 899
       <window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
900
+      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
882 901
       <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
883
-      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
884
-      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32922536" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
885 902
       <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
903
+      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
886 904
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
905
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32922536" sideWeight="0.5030441" order="9" side_tool="true" content_ui="tabs" />
906
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
907
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.49695587" order="10" side_tool="false" content_ui="tabs" />
908
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32688928" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
909
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32922536" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
887 910
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
888 911
       <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
889 912
       <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
890 913
       <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2006079" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
891
-      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
892
-      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32922536" sideWeight="0.5030441" order="9" side_tool="true" content_ui="tabs" />
893
-      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.49695587" order="10" side_tool="false" content_ui="tabs" />
894 914
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
895 915
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
896 916
       <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
897 917
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3996479" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
898
-      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32688928" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
899 918
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
900 919
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
901 920
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
@@ -914,7 +933,6 @@
914 933
     <option name="myLimit" value="2678400000" />
915 934
   </component>
916 935
   <component name="VcsManagerConfiguration">
917
-    <MESSAGE value="evolution" />
918 936
     <MESSAGE value="evolution (pikachu evolue en raichu)" />
919 937
     <MESSAGE value="+mieux l'interface et easter egg ajouté" />
920 938
     <MESSAGE value="fin de journé" />
@@ -939,7 +957,8 @@
939 957
     <MESSAGE value="redimensionnement de certains elms" />
940 958
     <MESSAGE value="++mieux" />
941 959
     <MESSAGE value="Si tu lis ce message, c'est que tu sait lire." />
942
-    <option name="LAST_COMMIT_MESSAGE" value="Si tu lis ce message, c'est que tu sait lire." />
960
+    <MESSAGE value="f,ekgfnje" />
961
+    <option name="LAST_COMMIT_MESSAGE" value="f,ekgfnje" />
943 962
   </component>
944 963
   <component name="XDebuggerManager">
945 964
     <breakpoint-manager>
@@ -1255,16 +1274,6 @@
1255 1274
         </state>
1256 1275
       </provider>
1257 1276
     </entry>
1258
-    <entry file="file://$PROJECT_DIR$/src/GestionBddDAO/GestionCategories.java">
1259
-      <provider selected="true" editor-type-id="text-editor">
1260
-        <state vertical-scroll-proportion="3.0298507">
1261
-          <caret line="114" column="61" selection-start-line="114" selection-start-column="61" selection-end-line="114" selection-end-column="61" />
1262
-          <folding>
1263
-            <element signature="imports" expanded="true" />
1264
-          </folding>
1265
-        </state>
1266
-      </provider>
1267
-    </entry>
1268 1277
     <entry file="file://$PROJECT_DIR$/src/GestionBddDAO/GestionReponses.java">
1269 1278
       <provider selected="true" editor-type-id="text-editor">
1270 1279
         <state vertical-scroll-proportion="0.5242537">
@@ -1273,10 +1282,20 @@
1273 1282
         </state>
1274 1283
       </provider>
1275 1284
     </entry>
1276
-    <entry file="file://$PROJECT_DIR$/src/InterfaceGraphique/InterfacePrincipale.java">
1285
+    <entry file="file://$PROJECT_DIR$/src/GestionBddDAO/GestionCategories.java">
1277 1286
       <provider selected="true" editor-type-id="text-editor">
1278 1287
         <state vertical-scroll-proportion="0.0">
1279
-          <caret line="425" column="45" selection-start-line="425" selection-start-column="45" selection-end-line="425" selection-end-column="45" />
1288
+          <caret line="83" column="44" selection-start-line="83" selection-start-column="44" selection-end-line="83" selection-end-column="44" />
1289
+          <folding>
1290
+            <element signature="imports" expanded="true" />
1291
+          </folding>
1292
+        </state>
1293
+      </provider>
1294
+    </entry>
1295
+    <entry file="file://$PROJECT_DIR$/src/GestionBddDAO/ConnexionBDD.java">
1296
+      <provider selected="true" editor-type-id="text-editor">
1297
+        <state vertical-scroll-proportion="0.0">
1298
+          <caret line="24" column="11" selection-start-line="24" selection-start-column="11" selection-end-line="24" selection-end-column="11" />
1280 1299
           <folding />
1281 1300
         </state>
1282 1301
       </provider>
@@ -1284,7 +1303,7 @@
1284 1303
     <entry file="file://$PROJECT_DIR$/src/GestionErreurs/BDDException.java">
1285 1304
       <provider selected="true" editor-type-id="text-editor">
1286 1305
         <state vertical-scroll-proportion="0.0">
1287
-          <caret line="7" column="5" selection-start-line="7" selection-start-column="5" selection-end-line="7" selection-end-column="5" />
1306
+          <caret line="8" column="1" selection-start-line="8" selection-start-column="1" selection-end-line="8" selection-end-column="1" />
1288 1307
           <folding>
1289 1308
             <element signature="e#109#110#0" expanded="true" />
1290 1309
             <element signature="e#130#131#0" expanded="true" />
@@ -1292,10 +1311,10 @@
1292 1311
         </state>
1293 1312
       </provider>
1294 1313
     </entry>
1295
-    <entry file="file://$PROJECT_DIR$/src/GestionBddDAO/ConnexionBDD.java">
1314
+    <entry file="file://$PROJECT_DIR$/src/InterfaceGraphique/InterfacePrincipale.java">
1296 1315
       <provider selected="true" editor-type-id="text-editor">
1297
-        <state vertical-scroll-proportion="0.42910448">
1298
-          <caret line="107" column="6" selection-start-line="107" selection-start-column="6" selection-end-line="107" selection-end-column="6" />
1316
+        <state vertical-scroll-proportion="0.33266932">
1317
+          <caret line="361" column="26" selection-start-line="361" selection-start-column="19" selection-end-line="361" selection-end-column="26" />
1299 1318
           <folding />
1300 1319
         </state>
1301 1320
       </provider>

+ 1
- 1
java/src/GestionErreurs/BDDException.java Bestand weergeven

@@ -6,4 +6,4 @@ public class BDDException extends Exception
6 6
 	{
7 7
 		super(message);
8 8
 	}
9
-}
9
+}

+ 160
- 46
java/src/InterfaceGraphique/InterfacePrincipale.java Bestand weergeven

@@ -1,5 +1,6 @@
1 1
 package InterfaceGraphique;
2 2
 
3
+import GestionErreurs.BDDException;
3 4
 import InterfaceGraphique.DialogBoxes.ConnexionBddDialog;
4 5
 import InterfaceGraphique.DialogBoxes.NouvelleQuestionDialog;
5 6
 import InterfaceGraphique.DialogBoxes.NouvelleReponseDialog;
@@ -60,6 +61,11 @@ public class InterfacePrincipale extends JFrame
60 61
 	private ConnexionBDD bdd;
61 62
 	private ConfigBDD configBDD;
62 63
 
64
+	//cst couleur
65
+	private static final Color ERROR_COLOR = Color.RED;
66
+	private static final Color INFO_COLOR = Color.CYAN;
67
+	private static final Color NORMAL_COLOR = Color.BLACK;
68
+
63 69
 	public InterfacePrincipale()
64 70
 	{
65 71
 		configBDD = new ConfigBDD();
@@ -73,10 +79,10 @@ public class InterfacePrincipale extends JFrame
73 79
 		setLayout(new BorderLayout());
74 80
 
75 81
 		loadImgBouton();
82
+		createStatusBar();
76 83
 		createPanelCategories();
77 84
 		createPanelReponses();
78 85
 		createPanelQuestion();
79
-		createStatusBar();
80 86
 
81 87
 
82 88
 		JSplitPane sp2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,panReponses,panQuestions);
@@ -120,7 +126,6 @@ public class InterfacePrincipale extends JFrame
120 126
 	private void createStatusBar()
121 127
 	{
122 128
 		statusBar = new JPanel(new BorderLayout(0,0));
123
-		statusText = new JLabel("Application demarrée, connexion à la base de donné effective. ");
124 129
 
125 130
 		Border border = BorderFactory.createMatteBorder(3,0,0,0, new Color(220,220,220));
126 131
 		statusBar.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10,70,5,70),border));
@@ -141,9 +146,17 @@ public class InterfacePrincipale extends JFrame
141 146
 			public void actionPerformed(ActionEvent actionEvent) {
142 147
 				configureBDD(false);
143 148
 				tryToConnect();
144
-				listC.setListData(bdd.getListeCategorie().toArray());
145
-				listR.setListData(new Vector(0));
146
-				listQ.setListData(new Vector(0));
149
+				try
150
+				{
151
+					listC.setListData(bdd.getListeCategorie().toArray());
152
+					listR.setListData(new Vector(0));
153
+					listQ.setListData(new Vector(0));
154
+					setStatusText("Connexion à la base de données établie.");
155
+				}
156
+				catch (BDDException e)
157
+				{
158
+					setStatusText(e.getMessage(), ERROR_COLOR);
159
+				}
147 160
 			}
148 161
 		});
149 162
 	}
@@ -155,7 +168,16 @@ public class InterfacePrincipale extends JFrame
155 168
 		delC = new Bouton("Supprimer la catégorie", delImg);
156 169
 		editC = new Bouton("Modifier la catégorie", editImg);
157 170
 
158
-		listC = new JList(bdd.getListeCategorie().toArray());
171
+		try
172
+		{
173
+			listC = new JList(bdd.getListeCategorie().toArray());
174
+			setStatusText("Application demarrée, connexion à la base de données initiée.");
175
+		}
176
+		catch (BDDException e)
177
+		{
178
+			setStatusText(e.getMessage(), ERROR_COLOR);
179
+		}
180
+
159 181
 		JScrollPane sp = new JScrollPane(listC,
160 182
 				JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
161 183
 				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
@@ -340,7 +362,13 @@ public class InterfacePrincipale extends JFrame
340 362
 		statusText.setText(message);
341 363
 	}
342 364
 
343
-	private void reSelectCategorie(String newCatName)
365
+	private void setStatusText(String message)
366
+	{
367
+		statusText.setForeground(NORMAL_COLOR);
368
+		statusText.setText(message);
369
+	}
370
+
371
+	private void reSelectCategorie(String newCatName) throws BDDException
344 372
 	{
345 373
 		Object[] tabObject = bdd.getListeCategorie().toArray();
346 374
 		Categorie[] tabCategorie = Arrays.copyOf(tabObject, tabObject.length, Categorie[].class);
@@ -356,7 +384,7 @@ public class InterfacePrincipale extends JFrame
356 384
 		}
357 385
 	}
358 386
 
359
-	private void reSelectReponses(String rep1, String rep2)
387
+	private void reSelectReponses(String rep1, String rep2) throws BDDException
360 388
 	{
361 389
 		Object[] tabObject = bdd.getListeReponses(listC.getSelectedValue().toString()).toArray();
362 390
 		Reponses[] tabReponses = Arrays.copyOf(tabObject, tabObject.length, Reponses[].class);
@@ -372,7 +400,7 @@ public class InterfacePrincipale extends JFrame
372 400
 		}
373 401
 	}
374 402
 
375
-	private void reSelectQuestion(String intitule)
403
+	private void reSelectQuestion(String intitule) throws BDDException
376 404
 	{
377 405
 		Reponses r = (Reponses) listR.getSelectedValue();
378 406
 		Object[] tabObject = bdd.getListeQuestions(r.getReponse1(), r.getReponse2()).toArray();
@@ -419,13 +447,21 @@ public class InterfacePrincipale extends JFrame
419 447
 				}
420 448
 				else if(catName.isEmpty())
421 449
 				{
422
-					statusText.setText("Une categorie ne peut porter un nom vide.");
450
+					setStatusText("Une categorie ne peut porter un nom vide.", INFO_COLOR);
423 451
 					return ;
424 452
 				}
425 453
 
426
-				bdd.createCategorie(catName);
427
-				reSelectCategorie(catName);
428
-				listQ.setListData(new Vector(0));
454
+				try
455
+				{
456
+					bdd.createCategorie(catName);
457
+					reSelectCategorie(catName);
458
+					listQ.setListData(new Vector(0));
459
+					setStatusText("La catégorie " + catName + " à bien été créée.");
460
+				}
461
+				catch (BDDException ex)
462
+				{
463
+					setStatusText(ex.getMessage(), ERROR_COLOR);
464
+				}
429 465
 			}
430 466
 			else if(e.getSource() == delC)
431 467
 			{
@@ -433,7 +469,7 @@ public class InterfacePrincipale extends JFrame
433 469
 
434 470
 				if(c == null)
435 471
 				{
436
-					statusText.setText("Veuiller d'abord selectionner une categorie.");
472
+					setStatusText("Veuiller d'abord selectionner une categorie.", INFO_COLOR);
437 473
 					return;
438 474
 				}
439 475
 
@@ -441,10 +477,18 @@ public class InterfacePrincipale extends JFrame
441 477
 
442 478
 				if(JOptionPane.showConfirmDialog(null, "Voulez vous vraiment supprimer la catégorie " + categorieName + " ?\nCela supprimera aussi toute les reponses et questions associé à cette catégorie.", "Supression de catégorie", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION)
443 479
 				{
444
-					bdd.deleteCategorie(categorieName);
445
-					listC.setListData(bdd.getListeCategorie().toArray());
446
-					listR.setListData(new Vector(0));
447
-					listQ.setListData(new Vector(0));
480
+					try
481
+					{
482
+						bdd.deleteCategorie(categorieName);
483
+						listC.setListData(bdd.getListeCategorie().toArray());
484
+						listR.setListData(new Vector(0));
485
+						listQ.setListData(new Vector(0));
486
+						setStatusText("La catégorie " + categorieName + "à bien été suprimée.");
487
+					}
488
+					catch (BDDException ex)
489
+					{
490
+						setStatusText(ex.getMessage(), ERROR_COLOR);
491
+					}
448 492
 				}
449 493
 			}
450 494
 			else if(e.getSource() == editC)
@@ -453,7 +497,7 @@ public class InterfacePrincipale extends JFrame
453 497
 
454 498
 				if(c == null)
455 499
 				{
456
-					statusText.setText("Veuiller d'abord selectionner une categorie.");
500
+					setStatusText("Veuiller d'abord selectionner une categorie.", INFO_COLOR);
457 501
 					return;
458 502
 				}
459 503
 
@@ -470,12 +514,20 @@ public class InterfacePrincipale extends JFrame
470 514
 				}
471 515
 				else if(newCatName.isEmpty())
472 516
 				{
473
-					statusText.setText("Une categorie ne peut porter un nom vide.");
517
+					setStatusText("Une categorie ne peut porter un nom vide.", INFO_COLOR);
474 518
 					return ;
475 519
 				}
476 520
 
477
-				bdd.renameCategorie(oldCatName, newCatName);
478
-				reSelectCategorie(newCatName);
521
+				try
522
+				{
523
+					bdd.renameCategorie(oldCatName, newCatName);
524
+					reSelectCategorie(newCatName);
525
+					setStatusText("La catégorie " + oldCatName + " à bien été renomée en " + newCatName + ".");
526
+				}
527
+				catch (BDDException ex)
528
+				{
529
+					setStatusText(ex.getMessage(), ERROR_COLOR);
530
+				}
479 531
 			}
480 532
 		}
481 533
 
@@ -483,8 +535,15 @@ public class InterfacePrincipale extends JFrame
483 535
 		{
484 536
 			if(!listC.isSelectionEmpty())
485 537
 			{
486
-				listR.setListData(bdd.getListeReponses(listC.getSelectedValue().toString()).toArray());
487
-				listQ.setListData(new Vector(0));
538
+				try
539
+				{
540
+					listR.setListData(bdd.getListeReponses(listC.getSelectedValue().toString()).toArray());
541
+					listQ.setListData(new Vector(0));
542
+				}
543
+				catch (BDDException ex)
544
+				{
545
+					setStatusText(ex.getMessage(), ERROR_COLOR);
546
+				}
488 547
 			}
489 548
 		}
490 549
 	}
@@ -495,7 +554,7 @@ public class InterfacePrincipale extends JFrame
495 554
 		{
496 555
 			if(listC.isSelectionEmpty())
497 556
 			{
498
-				statusText.setText("Veuillez selectioner une catégorie.");
557
+				setStatusText("Veuillez selectioner une catégorie.", INFO_COLOR);
499 558
 				return;
500 559
 			}
501 560
 
@@ -505,8 +564,16 @@ public class InterfacePrincipale extends JFrame
505 564
 				if(nrd.afficher() == true)
506 565
 				{
507 566
 					String catName = listC.getSelectedValue().toString();
508
-					bdd.createReponses(catName, nrd.getRep1(), nrd.getRep2());
509
-					reSelectReponses(nrd.getRep1(), nrd.getRep2());
567
+					try
568
+					{
569
+						bdd.createReponses(catName, nrd.getRep1(), nrd.getRep2());
570
+						reSelectReponses(nrd.getRep1(), nrd.getRep2());
571
+						setStatusText("Le jeu de réponse à bien été créé.");
572
+					}
573
+					catch (BDDException ex)
574
+					{
575
+						setStatusText(ex.getMessage(), ERROR_COLOR);
576
+					}
510 577
 				}
511 578
 			}
512 579
 			else if(e.getSource() == delR)
@@ -515,7 +582,7 @@ public class InterfacePrincipale extends JFrame
515 582
 
516 583
 				if(r == null)
517 584
 				{
518
-					statusText.setText("Veuiller d'abord selectionner un jeu de réponses.");
585
+					setStatusText("Veuiller d'abord selectionner un jeu de réponses.", INFO_COLOR);
519 586
 					return;
520 587
 				}
521 588
 
@@ -524,9 +591,17 @@ public class InterfacePrincipale extends JFrame
524 591
 
525 592
 				if(JOptionPane.showConfirmDialog(null,"Voulez vous vraiment supprimer le jeu de réponses " + reponse1 + ", " + reponse2 + " ?\nCela supprimera aussi toutes les questions associé à cette catégorie.", "Supression de réponses", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION)
526 593
 				{
527
-					bdd.deleteReponses(reponse1, reponse2);
528
-					listR.setListData(bdd.getListeReponses(listC.getSelectedValue().toString()).toArray());
529
-					listQ.setListData(new Vector(0));
594
+					try
595
+					{
596
+						bdd.deleteReponses(reponse1, reponse2);
597
+						listR.setListData(bdd.getListeReponses(listC.getSelectedValue().toString()).toArray());
598
+						listQ.setListData(new Vector(0));
599
+						setStatusText("Le jeu de réponse à bien été suprimé.");
600
+					}
601
+					catch (BDDException ex)
602
+					{
603
+						setStatusText(ex.getMessage(), ERROR_COLOR);
604
+					}
530 605
 				}
531 606
 			}
532 607
 			else if(e.getSource() == editR)
@@ -535,7 +610,7 @@ public class InterfacePrincipale extends JFrame
535 610
 
536 611
 				if(r == null)
537 612
 				{
538
-					statusText.setText("Veuiller d'abord selectionner un jeu de réponses.");
613
+					setStatusText("Veuiller d'abord selectionner un jeu de réponses.", INFO_COLOR);
539 614
 					return;
540 615
 				}
541 616
 
@@ -546,9 +621,17 @@ public class InterfacePrincipale extends JFrame
546 621
 				NouvelleReponseDialog nrd = new NouvelleReponseDialog("Modification jeu de réponses", reponse1, reponse2, catName, getCategorieList(), null);
547 622
 				if(nrd.afficher() == true)
548 623
 				{
549
-					bdd.modifyReponses(nrd.getCat(), reponse1, reponse2, nrd.getRep1(), nrd.getRep2());
550
-					reSelectCategorie(nrd.getCat());
551
-					reSelectReponses(nrd.getRep1(), nrd.getRep2());
624
+					try
625
+					{
626
+						bdd.modifyReponses(nrd.getCat(), reponse1, reponse2, nrd.getRep1(), nrd.getRep2());
627
+						reSelectCategorie(nrd.getCat());
628
+						reSelectReponses(nrd.getRep1(), nrd.getRep2());
629
+						setStatusText("Le jeu de réponse à bien été modifié.");
630
+					}
631
+					catch (BDDException ex)
632
+					{
633
+						setStatusText(ex.getMessage(), ERROR_COLOR);
634
+					}
552 635
 				}
553 636
 			}
554 637
 		}
@@ -558,7 +641,14 @@ public class InterfacePrincipale extends JFrame
558 641
 			if(!listR.isSelectionEmpty())
559 642
 			{
560 643
 				Reponses r = (Reponses) listR.getSelectedValue();
561
-				listQ.setListData(bdd.getListeQuestions(r.getReponse1(), r.getReponse2()).toArray());
644
+				try
645
+				{
646
+					listQ.setListData(bdd.getListeQuestions(r.getReponse1(), r.getReponse2()).toArray());
647
+				}
648
+				catch (BDDException e)
649
+				{
650
+					setStatusText(e.getMessage(), ERROR_COLOR);
651
+				}
562 652
 			}
563 653
 		}
564 654
 	}
@@ -569,7 +659,7 @@ public class InterfacePrincipale extends JFrame
569 659
 		{
570 660
 			if(listR.isSelectionEmpty())
571 661
 			{
572
-				statusText.setText("Veuillez selectioner une sous-catégorie.");
662
+				setStatusText("Veuillez selectioner une sous-catégorie.", INFO_COLOR);
573 663
 				return;
574 664
 			}
575 665
 
@@ -581,8 +671,16 @@ public class InterfacePrincipale extends JFrame
581 671
 
582 672
 				if(nqd.afficher() == true)
583 673
 				{
584
-					bdd.createQuestion(nqd.getIntitule(), r.getReponse1(), r.getReponse2(), nqd.getReponse());
585
-					reSelectQuestion(nqd.getIntitule());
674
+					try
675
+					{
676
+						bdd.createQuestion(nqd.getIntitule(), r.getReponse1(), r.getReponse2(), nqd.getReponse());
677
+						reSelectQuestion(nqd.getIntitule());
678
+						setStatusText("La question à bien été créée.");
679
+					}
680
+					catch (BDDException ex)
681
+					{
682
+						setStatusText(ex.getMessage(), ERROR_COLOR);
683
+					}
586 684
 				}
587 685
 			}
588 686
 			else if(e.getSource() == delQ)
@@ -591,14 +689,22 @@ public class InterfacePrincipale extends JFrame
591 689
 
592 690
 				if(q == null)
593 691
 				{
594
-					statusText.setText("Veuiller d'abord selectionner une question.");
692
+					setStatusText("Veuiller d'abord selectionner une question.", INFO_COLOR);
595 693
 					return;
596 694
 				}
597 695
 
598 696
 				if(JOptionPane.showConfirmDialog(null, "Voulez vous vraiment supprimer la question " + q.getIntitule() + " ?", "Supression de question", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION)
599 697
 				{
600
-					bdd.deleteQuestion(q.getIntitule(), q.getReponse1(), q.getReponse2());
601
-					listQ.setListData(bdd.getListeQuestions(q.getReponse1(), q.getReponse2()).toArray());
698
+					try
699
+					{
700
+						bdd.deleteQuestion(q.getIntitule(), q.getReponse1(), q.getReponse2());
701
+						listQ.setListData(bdd.getListeQuestions(q.getReponse1(), q.getReponse2()).toArray());
702
+						setStatusText("La question à bien été suprimée.");
703
+					}
704
+					catch (BDDException ex)
705
+					{
706
+						setStatusText(ex.getMessage(), ERROR_COLOR);
707
+					}
602 708
 				}
603 709
 			}
604 710
 			else if(e.getSource() == editQ)
@@ -606,7 +712,7 @@ public class InterfacePrincipale extends JFrame
606 712
 				Question q = (Question) listQ.getSelectedValue();
607 713
 				if(q == null)
608 714
 				{
609
-					statusText.setText("Veuiller d'abord selectionner une question.");
715
+					setStatusText("Veuiller d'abord selectionner une question.", INFO_COLOR);
610 716
 					return;
611 717
 				}
612 718
 
@@ -615,9 +721,17 @@ public class InterfacePrincipale extends JFrame
615 721
 
616 722
 				if(nqd.afficher() == true)
617 723
 				{
618
-					bdd.modifyQuestion(q.getIntitule(), nqd.getIntitule(),
619
-							q.getReponse1(), q.getReponse2(), nqd.getReponse());
620
-					reSelectQuestion(nqd.getIntitule());
724
+					try
725
+					{
726
+						bdd.modifyQuestion(q.getIntitule(), nqd.getIntitule(),
727
+								q.getReponse1(), q.getReponse2(), nqd.getReponse());
728
+						reSelectQuestion(nqd.getIntitule());
729
+						setStatusText("La question à bien été modifiée.");
730
+					}
731
+					catch (BDDException ex)
732
+					{
733
+						setStatusText(ex.getMessage(), ERROR_COLOR);
734
+					}
621 735
 				}
622 736
 			}
623 737
 		}