A: 

You have to care it by yourself:

  • first of all you can catch every kind of action that is used on the button to change the state (like in the code, where mouseIn is used to change a color)
  • then you have to care about every single paint detail you need, for example for gradients you should point to class GradientPaint that is used to draw gradients..

By the way mind that you have to take care of various look-and-feels and that your solution will fit just one of these..

Jack
+1  A: 

I think you've got 2 choices here:

1.Implement drawing yourself in a paint method of your component

2.Create new ButtonUI for your look and feel. In this case i would suggest to use Synch LAF

In both cases drawing different states is your resposibility

eugener
Agreed. StackOverflow isn't about doing ALL of your work for you. If you want to do gradients, i'm sure someone's asked "how do i draw a gradient in swing" (See GradientPaint), etc.
John Gardner
A: 

The best implementation I have seen of rounded buttons in Swing are in the Substance look and feel:

https://substance.dev.java.net/

Not all themes have rounded buttons so you may need to change the defaults in the demo. The project is open source so it might be worth poking around in the code for some ideas.

Russ Hayward