views:

109

answers:

3

Hi

I wanted to know how to display a group of JButtons to look like smooth panel without raised portion.

thanks

A: 

I've often just used standard JLabels and added mouseListeners to make them clickable. Alternatively, you could get more advanced and create your own ButtonUI class if you want to really fine-grained control over the rendering of the buttons.

BryanD
+2  A: 
button.setBorder(null);

You may want to look at some of the other "setXXX" method that control painting as well.

camickr
can also use button.setBorderPainted(false);
changed
A: 

If you want the buttons to be in a row, you can put them in a JToolBar and set Rollover to true. This will make flat buttons that, with mouse over, look raised.

Milan Ramaiya