• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem about adding component to Panel

 
BJon Jo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I drop my object onto the panel. I command button to be created and added to the panel. However, the button does not show up immediately, it shows up only after I resize or minimised my window. How to make the button shows up immediately??
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you call validate() (and also possibly repaint()) on the panel you are adding the button to... the panel has to lay itself out again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!