File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JButton Round Shape Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JButton Round Shape" Watch "JButton Round Shape" New topic

JButton Round Shape

Naveen Kumar
Ranch Hand

Joined: Dec 14, 2006
Posts: 35
Hi All,

Is it possible to change the shape of a JButton/Button to be Round?
Could you please send me sample Code.

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
search the forum for
circular buttons

you should find what you are looking for
Malith Yapa
Ranch Hand

Joined: Jan 17, 2007
Posts: 45
What you have to do is create your own button class which extends from jbutton or button.

**) After that you can simply override the paint method(create your own) and draw the actual thing you want the button to look like. Could be round or anything. You'll need to have some skill though. After some time it won't be much of a problem..

Otherwise unless you use some new package (which is not found in the api) you better stick to the **) method
Brian Cole
Ranch Hand

Joined: Sep 20, 2005
Posts: 878
Well you don't have to create your own button class. You could try something like this:

It depends on what you want to do.

bitguru blog
I agree. Here's the link:
subject: JButton Round Shape
It's not a secret anymore!