Vikram
Vikram

Reputation: 4106

Possible to change the shape of JButton?

Is it possible to change the shape of JButton from rectangular to say round?

Upvotes: 5

Views: 27893

Answers (2)

exexzian
exexzian

Reputation: 7890

Link provided by Sean Cogan is all you need. If you want it in short ,set an image (rounded or any shape that you want your button should look alike) using setIcon and then on the JButton (button1) set these values -

button1.setContentAreaFilled(false);
button1.setFocusPainted(false);
button1.setBorderPainted(false);

Upvotes: 8

Rish
Rish

Reputation: 457

You can also use an image over the button .

Upvotes: 5

Related Questions