Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

paint() and repaint()

 
Jesse Walker
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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) {
content.setBackground(Color.red)


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
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind figured out on my own
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic