• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

resizing JPanel

 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Often when I add a widget to a JPanel that is on a JFrame, it doesn't show up. I had the same problem with JFrame. Stuff that I added to a JFrame didn't show up. I figured out that if you resize the JFrame, or use pack(), or setVisible(true), the changes made to JFrame would become visible. Is there some kind of command that you should use for a JPanel that would make it reflect changes in its content (specifically, showing the added widget)?
 
Brian Cole
Author
Ranch Hand
Posts: 908
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try revalidate().
 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic