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 Changing the shape of JButton ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Changing the shape of JButton ?" Watch "Changing the shape of JButton ?" New topic

Changing the shape of JButton ?

Mufaddal Khumri

Joined: Jun 13, 2002
Posts: 9
I am trying to change the shape of JButton. I have understood that for this I have to use the ButtonUI class and the UIManager class. But somehow I havent been able to bridge all the bits of information. Does someone have a code example showing a JButton of a shape other than the standard rectangular shape ?
Shashi Kanta
Ranch Hand

Joined: May 08, 2002
Posts: 89

awt :
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Welcome to the JavaRanch! Please adjust your displayed name to meet
the <BR>JavaRanch
Naming Policy
. <BR>You can change it here.<BR><BR>Thanks!
and welcome to the JavaRanch!
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

I have seen that example as well as others before, and not that I could do any better, but those buttons are just plain ugly.
How about an example of a nice raised border Swing Round Button? I mean one exactly like the standard swing button, but round?

GenRocket - Experts at Building Test Data
Mufaddal Khumri

Joined: Jun 13, 2002
Posts: 9
Thanks Sashi , but I had come across that link already. I want something more like what Greg described. The button needs to look like a button like JButton , just another shape. Not just a colored circle or something.
I agree. Here's the link:
subject: Changing the shape of JButton ?
It's not a secret anymore!