• Post Reply Bookmark Topic Watch Topic
  • New Topic

Resizing a frame  RSS feed

 
Flavio Nobili
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all,
I've written an application using swing components. The main window is a JFrame, which has some components that will not be well presented if the frame becomes very little in size. I would like to allow the user to resize the frame, but I need to set a minimmum size. Do you know how can I do that?
Thanks,
Fl�vio.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, JFrame doesn't honour minimum sizes you set and stop the resize of the frame. This probably has something to do with native frame resources...

But you can make the frame go back to a certain size if it is sized below it by using ComponentListener. There is a code example of this on JavaWorld.
 
Flavio Nobili
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Nathan,
It's really helped me.

Fl�vio.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!