• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problems with repainting the screen

 
Mike Phillip
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm with troubles in this applet, I created a button that when clicked creates another.

But the screen doesn't show the new button unless I resize the screen with the mouse.

here's a code example of what I'm doing:



how can it repaint without resizing?

thanks
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When adding or removing components the layout needs to be redone. The easiest way to do that is to call "invalidate()" before "repaint()".
 
Mike Phillip
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, before you reply I tested the validate(), works.

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic