This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes paint() and repaint() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "paint() and repaint()" Watch "paint() and repaint()" New topic

paint() and repaint()

Jesse Walker
Ranch Hand

Joined: Aug 18, 2004
Posts: 50
Just a quick question, I am trying to build a program that will let you click a button to change the background color of a frame. in my actionPerformed method I have the following

if(ae.getSource() == red1) {

That is where I am stuck, I know I need to call repaint() but what should I put in the paint() method? I have nothing in it right now but was thinking that I should put the actual code that makes the frame visible is that right??
Thanks in advance
Jesse Walker
Ranch Hand

Joined: Aug 18, 2004
Posts: 50
Nevermind figured out on my own
It is sorta covered in the JavaRanch Style Guide.
subject: paint() and repaint()
jQuery in Action, 3rd edition