• Post Reply Bookmark Topic Watch Topic
  • New Topic

A gradient paint background for a JLabel  RSS feed

 
Rupert Brown
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a JTree that simply holds Strings. As I understand it, these Strings are written inside JLabels - its basically a tree of JLabels. I have successfully changed the background colour of my JLabels but - to make the JLabels match the look and feel of other GUI components I have created, I need to be able to put a gradient onto the background of the JLabel. Any ideas as to how I can do that?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Rupert Brown
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maneesh - that looks like a great reference. I'll read it further, but it looks like a simple matter of creating the gradient paint, and then just using setPaint on the JLabel. Cheers.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!