• 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: 42970
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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!