Question

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

thanks

Was it helpful?

Solution

button.setBorder(null);

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

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top