Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

resizing JInternalFrame when content grows

 
Pieter-Jan Malfait
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

i have a JPanel inside a JInternalFrame that can change its size (it grows)
is there any way to make the JInternalFrame grow with it, now i have to manually resize it...

thanks a lot in advance!
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try calling pack() on the JInternalFrame after the panel is resized. That will resize it to its preferred size.

I don't think there is a way to have the JInternalFrame resize automatically, but pack() is at least easier than manually resizing.
 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!