Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes Change Background color on button Click Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Change Background color on button Click" Watch "Change Background color on button Click" New topic
Author

Change Background color on button Click

khushbushah shah
Greenhorn

Joined: Jun 25, 2012
Posts: 10
Hi

I want to change Background color of Jpanel and its font on button click.

Can anyone tell me what i am doing wrong?
Here is the code:
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> I want to change Background color of Jpanel and its font on button click.

how does the button know you want to do that?
khushbushah shah
Greenhorn

Joined: Jun 25, 2012
Posts: 10
hi,

When user Clicked on button action event will called from test3 class
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> When user Clicked on button action event will called...

how does the button know about the action event?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Change Background color on button Click
 
Similar Threads
Canvas & Scrollbras integrated
increase size of scrollpane at run time
Need help with my game.
Canvas with ScrollPane
Applet/ Animation/ repaint-update-paint ?