• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I autodraw with custom JComponent?

 
Bupjae Lee
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I use this component in JScrollPane, and when model is changed, this component should recalculate its size and redisplay.

I tried to repaint(), but it didn't recalculate size.
 
Brian Cole
Author
Ranch Hand
Posts: 920
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try calling revalidate() after this.model=model.
 
Bupjae Lee
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works perfectly
Thanks, Brian
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!