Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JButton Round Shape

 
Naveen Kumar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

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

Regards
Naveen
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
search the forum for
circular buttons

you should find what you are looking for
 
Malith Yapa
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Author
Ranch Hand
Posts: 908
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic