Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

repaint problem

 
sharingan reddy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to add a panel taking radio button selected the panels are adding but the previous panel is not erasing even on repaint() on the parent panel.
how to resolve thatjavascript:emoticon('');
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After you add/remove the panel, invoke revalidate() and repaint() on the parent panel
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also wonder if a CardLayout would work for you. Are you swapping JPanels? If so, you may want to look into this.

Best of luck!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic