• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to add Gradient colors to JComponents.

 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1561
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic