Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

restricting JFrame resize to some minimum size  RSS feed

 
Jain Neeraj
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to set the minimum resizable size of a JFrame. More specifically i should be able to resize it to make bigger but not less then some specific size.
thanks,
Neeraj
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may not be great... but you can listen for resizes below the minimum size and pop the JFrame back to it's minimum size...



There may be something new in the 1.4 JDK that lets you do this... but if so, I haven't found it yet...

-Nate
 
Jain Neeraj
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nate for the nice code, but i need to restrict the user to be unable to resize below a min size...and the application has to use JDK1.3 and not newer than that....
-N.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!