Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom JButton with Metal Look and Feel  RSS feed

 
Kevin Lillybridge
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All, I'm slowly creating some custom SWING components that use round corners as opposed to the standard 90 degree angles. So far I have created a JFrame, JButton, and JTextField. I want the look and feel to remain the same as the metal look and feel. The only thing different will be round corners. Is anyone aware of how to make the custom JButton use the Metal Gradient is does for the standard implementation. JButton code below, Thanks in advance for the help.
 
Rob Spoor
Sheriff
Posts: 21090
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of creating custom components, you could also use a different look & feel. Check How to Set the Look and Feel of the Java Tutorial.

Especially the next page, about the Synth look & feel (available since Java 5.0) can help you a lot. There's a good example there on how to do it.
 
Kevin Lillybridge
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of creating custom components, you could also use a different look & feel. Check How to Set the Look and Feel of the Java Tutorial.

Especially the next page, about the Synth look & feel (available since Java 5.0) can help you a lot. There's a good example there on how to do it.


Thanks Rob, I'll give this a try.

Appreciate the help.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!