This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How Can I use Different shape  of Buttons??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How Can I use Different shape  of Buttons???" Watch "How Can I use Different shape  of Buttons???" New topic
Author

How Can I use Different shape of Buttons???

sandhiya sindhi
Ranch Hand

Joined: Sep 25, 2003
Posts: 50
How Can I use Different shape of Buttons... there is no constructor through wich we set size of button and its angles..
Like as a round Button or a like Star Button.
[ October 01, 2003: Message edited by: sandhiya Laghari ]
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You have to do all this yourself... extend JComponent, override the paintComponent() method to draw whatever shape you want, enable ActionEvents on the component, and add a MouseListener that fires ActionEvents whenever it gets a click inside the shape you have drawn.

Easy as pie.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
sandhiya sindhi
Ranch Hand

Joined: Sep 25, 2003
Posts: 50
Thank u very much Mr Nathan for giving this idea.
I'm so Gad to get solution of this
 
 
subject: How Can I use Different shape of Buttons???
 
Similar Threads
making buttons circular
custom shaped gui components?
Applet that lets you draw shapes, custom component and action
Making components look the way you want them to
one button enabled/disabled when some other button pressed/not pressed