954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to cheange the color in the background.

hey

is anyone know how to change background color when you click a button.... please tell me. im creating a applet.. need sup

lich
Junior Poster in Training
79 posts since May 2008
Reputation Points: -1
Solved Threads: 4
 

hey

is anyone know how to change background color when you click a button.... please tell me. im creating a applet.. need sup

Within applet context...

//assuming Applet context

// assuming button has the listener registered with this overridden method--
public void actionPerformed(ActionEvent e){

     getContentPane().setBackground(new Color(200, 100, 50));

}
Alex Edwards
Posting Shark
972 posts since Jun 2008
Reputation Points: 392
Solved Threads: 109
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You