Setting minimum width on JDialog
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Janelle_Dahling
Posted On:   Friday, August 31, 2001 07:32 AM

I have a JDialog window with a Container in it. The JDialog is resizable and the Container contains a JSplitPane with two components in it - a JScrollPane with a JTextPane in it and a JList. I'm using jvm 1.2. When I resize the JDialog, the inner components resize so that the Horizontal divider bar in the JScrollPane maintains a constant width for the right JList and only modifies the left JScrollPane size. The problem I have is that this works great until I resize the JDialog narrower than the width of the JList (right component). When I do that, it actually narrows the width of the JList to accomodate the new size. What I really want to do is set a minimum width on the JDialog to prevent a user fro   More>>

I have a JDialog window with a Container in it. The JDialog is resizable and the Container contains a JSplitPane with two components in it - a JScrollPane with a JTextPane in it and a JList. I'm using jvm 1.2.


When I resize the JDialog, the inner components resize so that the Horizontal divider bar in the JScrollPane maintains a constant width for the right JList and only modifies the left JScrollPane size.


The problem I have is that this works great until I resize the JDialog narrower than the width of the JList (right component). When I do that, it actually narrows the width of the JList to accomodate the new size.


What I really want to do is set a minimum width on the JDialog to prevent a user from resizing the Dialog smaller than the width of the right component, but there is no setMinimumWidth or setMinimumSize available for the JDialog.


Does anyone have any ideas on how I can accomplish this? If so, please e-mail me at jdahling@visi.com.


Thanks in advance!

   <<Less

Re: Setting minimum width on JDialog

Posted By:   Anonymous  
Posted On:   Tuesday, September 4, 2001 10:17 PM

If u want ur components to remain same irrespective of container size(ie resizeable parent container)
,then just do the following thing:

yourComponent.setPrefferedSize(new Dimension());
yourComponent.setMinimumSize(new Dimension());
About | Sitemap | Contact