svn commit: r488471 - /incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r488471 - /incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java

jleroux@apache.org
Author: jleroux
Date: Mon Dec 18 16:33:53 2006
New Revision: 488471

URL: http://svn.apache.org/viewvc?view=rev&rev=488471
Log:
Resolves point 3 in https://issues.apache.org/jira/browse/OFBIZ-259#action_12459196

Modified:
    incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java

Modified: incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java?view=diff&rev=488471&r1=488470&r2=488471
==============================================================================
--- incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java (original)
+++ incubator/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/PosDialog.java Mon Dec 18 16:33:53 2006
@@ -32,6 +32,7 @@
 import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JRootPane;
+import javax.swing.SwingUtilities;
 
 import net.xoetrope.swing.XButton;
 import net.xoetrope.swing.XTextArea;
@@ -58,6 +59,7 @@
     protected XPage page = null;
     protected boolean modal = true;
     protected int padding = 0;
+    protected boolean posVisible = false;
 
     public static PosDialog getInstance(XPage page) {
         return getInstance(page, true, 0);
@@ -216,9 +218,10 @@
 
         dialog.setFocusable(true);
         dialog.setEnabled(true);
-        dialog.setVisible(true);
         dialog.requestFocus();
         dialog.repaint();
+        dialog.pack();
+        posDialogSetVisible(true);
     }
 
     public void setText(String text) {
@@ -330,4 +333,15 @@
         return new Point(maxX, maxY);
     }
 
+      public void posDialogSetVisible(boolean visible){
+      posVisible = visible;
+      SwingUtilities.invokeLater(
+          new Runnable() {
+              public void run(){
+                  dialog.setVisible(posVisible);
+              }
+          }      
+      );
+    }
+    
 }