File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Changing the shape of JButton ?

Mufaddal Khumri
Greenhorn

Joined: Jun 13, 2002
Posts: 9
Hi.
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 ?
Regards.
Shashi Kanta
Ranch Hand

Joined: May 08, 2002
Posts: 89
Swings:

http://developer.java.sun.com/developer/TechTips/1999/tt0826.html

awt :
http://java.sun.com/products/jdk/1.1/docs/guide/awt/demos/lightweight/RoundButtons/example.html
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: 15299
    
    6

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
Greenhorn

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Changing the shape of JButton ?