@@ -203,47 +203,6 @@ public void repaint() {
203203 }
204204 }
205205
206- public String getUserInput (String message , String initialValue ) {
207- return JOptionPane .showInputDialog (canvas , message , initialValue );
208- }
209-
210- public void sendUserError (String message ) {
211- JOptionPane .showMessageDialog (canvas , message , "ERROR" , JOptionPane .ERROR_MESSAGE );
212- }
213-
214- public void sendUserWarning (String message ) {
215- JOptionPane .showMessageDialog (canvas , message , "WARNING" , JOptionPane .WARNING_MESSAGE );
216- }
217-
218- public void sendUserInfo (String message ) {
219- JOptionPane .showMessageDialog (canvas , message , "INFO" , JOptionPane .INFORMATION_MESSAGE );
220- }
221-
222- public boolean getUserConfirm (String message , String title ) {
223- return JOptionPane .showConfirmDialog (canvas , message , title , JOptionPane .OK_CANCEL_OPTION ,
224- JOptionPane .QUESTION_MESSAGE ) == JOptionPane .OK_OPTION ;
225- }
226-
227- /**
228- * Creates a popup-window which lets u choose one of the Options
229- *
230- * @param title displayed Toptext
231- * @param comboBoxInput String-Array of Options
232- * @return index from 0 to comboBoxInput.length. <b>If -1:</b> no valid Option was selected
233- */
234- public int getUserSelection (String title , String comboBoxInput []) {
235- JComboBox <String > box = new JComboBox <>(comboBoxInput );
236- JOptionPane .showMessageDialog (canvas , box , title , JOptionPane .QUESTION_MESSAGE );
237- return box .getSelectedIndex ();
238- }
239-
240- public int getUserSelection (String title , ArrayList <String > comboBoxInput ) {
241- String s [] = new String [comboBoxInput .size ()];
242- for (int i = 0 ; i < s .length ; i ++)
243- s [i ] = comboBoxInput .get (i );
244- return getUserSelection (title , s );
245- }
246-
247206 public int getMaxFrameRate () {
248207 return maxFrameRate ;
249208 }
@@ -292,4 +251,52 @@ public int compare(PUICanvas o1, PUICanvas o2) {
292251// }
293252 }
294253
254+ public String getUserInput (String message , String initialValue ) {
255+ return JOptionPane .showInputDialog (canvas , message , initialValue );
256+ }
257+
258+ public void sendUserError (String message ) {
259+ JOptionPane .showMessageDialog (canvas , message , "ERROR" , JOptionPane .ERROR_MESSAGE );
260+ }
261+
262+ public void sendUserWarning (String message ) {
263+ JOptionPane .showMessageDialog (canvas , message , "WARNING" , JOptionPane .WARNING_MESSAGE );
264+ }
265+
266+ public void sendUserInfo (String message ) {
267+ JOptionPane .showMessageDialog (canvas , message , "INFO" , JOptionPane .INFORMATION_MESSAGE );
268+ }
269+
270+ public boolean getUserConfirm (String message , String title ) {
271+ return JOptionPane .showConfirmDialog (canvas , message , title , JOptionPane .OK_CANCEL_OPTION ,
272+ JOptionPane .QUESTION_MESSAGE ) == JOptionPane .OK_OPTION ;
273+ }
274+
275+ /**
276+ * Creates a popup-window which lets u choose one of the Options
277+ *
278+ * @param title displayed Toptext
279+ * @param comboBoxInput String-Array of Options
280+ * @return index from 0 to comboBoxInput.length. <b>If -1:</b> no valid Option was selected
281+ */
282+ public int getUserSelection (String title , String comboBoxInput []) {
283+ JComboBox <String > box = new JComboBox <>(comboBoxInput );
284+ JOptionPane .showMessageDialog (canvas , box , title , JOptionPane .QUESTION_MESSAGE );
285+ return box .getSelectedIndex ();
286+ }
287+
288+ /**
289+ * Creates a popup-window which lets u choose one of the Options
290+ *
291+ * @param title
292+ * @param comboBoxInput String-ArrayList of Options
293+ * @return index from 0 to comboBoxInput.length
294+ */
295+ public int getUserSelection (String title , ArrayList <String > comboBoxInput ) {
296+ String s [] = new String [comboBoxInput .size ()];
297+ for (int i = 0 ; i < s .length ; i ++)
298+ s [i ] = comboBoxInput .get (i );
299+ return getUserSelection (title , s );
300+ }
301+
295302}
0 commit comments