• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Circular Buttons

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

how can i make 100% circular buttons. normally JButton comes as a square. evan i put a icon image and set null background, null border and setOpaque to false it will shoe it's like a circular button but true is it is not and it is not acting like a circular button so my problem is how to make a 100 % circular button



Thanks Lot
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://java.sun.com/developer/TechTips/1999/tt0826.html
 
Sameera Abeysinghe
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot
Following is my code I am using at now

So instead of creating JButton objects if I create RoundButton objects will my code work
( RoundButton � it is a class shown in the link show above)
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sameera,

Here is another workaround..

Use AWT graphics object and create a button on ur own. I mean instead of using JButton, create a round figure with bevel effect which will look similar to a JButton and then using MouseMove and mosueClick method and verifying the co-ordinates , u can simulate the click action.

this will give you 100% round button without any invisible square areas ..

if you liked this and want to have more details.mail me at amitgoel1287@yahoo.com
 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic