wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes How to add Gradient colors to JComponents. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to add Gradient colors to JComponents. " Watch "How to add Gradient colors to JComponents. " New topic
Author

How to add Gradient colors to JComponents.

Udara Amarasinghe
Ranch Hand

Joined: Aug 17, 2009
Posts: 109

Hi I want to add gradient color to JButton and JPanel. This is my code can you help me to solve this mater.

pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
what specifically is not working for you? Tell us this and we'll be much better able to help you. My guess is to add a gradient color background, paint it in the JComponent's paintComponent method. For instance:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to add Gradient colors to JComponents.