File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
I agree. Here's the link:
subject: paint() and repaint()
Similar Threads
repaint () not getting called inside Canvas
My panel object won't repaint(). Please help.
Animation Problem