Yes its possible to give any particular shape to a JButton, like Round or Rounded rectangle it's quiet easy, you can even give it a shape of polygon with many edges.
Refer to Apress publications, The Definitive Guide To Java Swing, June 2005, 3rd Edition, by John Zukowski. for more details.
I'll try to post an internet link as soon as i find one.
Hello swing_guy, is there limitation in shape that we can give ? I like to make a rounded shape button but not a regular circle. I dont know how to do it, but maybe if its possible to make a shape from other shape, like a round shape and an oval shape added together to give the shape of button i want. Is it possible or is there better straighter way to give shape to a button ? For exemple my button would round with a lump on the top.
I have this book from Apress :) but i didnt find anything for giving particular shape to button, maybe you could tell me what pages or chapter
Thx
well there is no limitation on what shape you can give to your button, they are only limited by one's visualization and creativity. I'll have to go through google and a few books, to see how complex shapes can be drawn, but i know it can be, i've seen an example recently.
For simple shapes you can implement the javax.swing.border.Border interface. and override the paintBorder(Component c, Graphics g, int x, int y, int width, int height) method to draw the border. This will give you some idea about the process.