Author: pwang
Date: 2011-03-31 16:58:52 -0700 (Thu, 31 Mar 2011)
New Revision: 24639

Modified:
   
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/TunnableDialog.java
Log:
Bug Fixed: resize the dialog automatically

Modified: 
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/TunnableDialog.java
===================================================================
--- 
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/TunnableDialog.java
       2011-03-31 02:53:08 UTC (rev 24638)
+++ 
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/TunnableDialog.java
       2011-03-31 23:58:52 UTC (rev 24639)
@@ -3,7 +3,6 @@
 import javax.swing.JDialog;
 import javax.swing.JPanel;
 import java.awt.Component;
-import java.awt.Dimension;
 
 public class TunnableDialog extends JDialog {
        
@@ -17,15 +16,9 @@
        
        //
        public void addComponent(Component optionPanel){
-               
-               // adjust the preferred size of optionPanel 
-               int w = optionPanel.getPreferredSize().width+30;
-               int h = optionPanel.getPreferredSize().height+30;
-               optionPanel.setPreferredSize(new Dimension(w, h));
-               
-               jScrollPane1.setViewportView(optionPanel);
-                               
-               pack();         
+               jScrollPane1.setViewportView(optionPanel);              
+               pack();
+               this.setSize(this.getSize().width+30, this.getSize().height+30);
        }
                
        // Set the text to replace the "OK" string on OK button

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to