• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDialog Resize

 
Ananya Mohan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there a way to set a minimum size for a JDialog while resizing?I tried setMinimumSize,it seems not to work.

Thanks.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> I tried setMinimumSize,it seems not to work.

works OK for me - winxp, java 1.6.0_01
 
Josh Britton
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by 'while resizing?' Is your size-setting code part of a WindowListener? If so, shouldn't you set the minimum size 'before resizing --' before you set the Dialog to visible?
 
Ananya Mohan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have set the Minimum size before setting the dialog to visible,but its not working.Am able to resize the dialog to zero.Is there anything else I should set?
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version is your JVM?
I don't know if it was Java 5.0 or Java 6, but one of those actually started listening to window minimum sizes. Java 1.4 surely didn't.
 
Ananya Mohan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use Java 5
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not sure if this works in 1.5, but before you create your dialog put this line

JDialog.setDefaultLookAndFeelDecorated(true);
then
JDialog d = new JDialog();//or similar
now set a minimumSize and see if it works
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!