-1

I want to draw a button border like this with gradient color at border of rounded button (the red one):

enter image description here

Does anybody know some Java class that can do this?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Hoangdise
  • 29
  • 3

1 Answers1

3

You can create your custom Button class by extending JButton. Then you have to rewrite the paintComponent(Grapgics g) mehtod to draw your button like you want.

domi
  • 375
  • 2
  • 10
  • Yes, I know i gotta do that. but the things is how can we draw the gradient border as i want. I don't know what i should do with Graphics2D g2 to draw that border – Hoangdise May 08 '14 at 09:08
  • 2
    *"I don't know what i should do with Graphics2D"* Umm.. look at the `paintBorder` method of `TextBubbleBorder`.. – Andrew Thompson May 08 '14 at 10:08