[Schmitzm-commits] r1862 - trunk/schmitzm-core/src/main/java/de/schmitzm/swing

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 10 17:18:56 CET 2012


Author: mojays
Date: 2012-02-10 17:18:55 +0100 (Fri, 10 Feb 2012)
New Revision: 1862

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
Log:
SwingUtil: new method showResizableJOptionPane(.)

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2012-02-10 15:49:10 UTC (rev 1861)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2012-02-10 16:18:55 UTC (rev 1862)
@@ -913,6 +913,23 @@
         setEditable(((JViewport)component).getView(), editable);
     }
 
+    /**
+     * Similar to {@link JOptionPane#showOptionDialog(Component, Object, String, int, int, Icon, Object[], Object),
+     * except that the dialog is resizable!
+     */
+    public static int showResizableJOptionPane(Component parent, Object message, String title, int messageType, int optionType, Icon icon, Object[] options, Object initialValue) {
+      JOptionPane pane = new JOptionPane(message,
+                                         messageType,
+                                         optionType,
+                                         icon,
+                                         options,
+                                         initialValue);
+      JDialog dialog = pane.createDialog(parent,title);
+      dialog.setResizable(true);
+      dialog.setVisible(true);
+      return (Integer)pane.getValue();
+    }
+    
 	/**
 	 * Erzeugt 5 {@link InputOption} fuer ein {@link MultipleOptionPane} zur
 	 * Datenbank-Anmeldung.



More information about the Schmitzm-commits mailing list