I created a small tool set which is composed of around 10 buttons. These buttons are added to a JToolBar
. Currently, it puts a square around the first button by default; however, I would like a different button to be the default. How can I accomplish this? Below is an example of how I am adding the buttons. I have tried select.setSelected
and a few other methods but haven't had any luck.
JToolBar sideBar = new JToolBar();
JButton select = new JButton(new ImageIcon("Media/select.png"));
select.setBorderPainted(false);
select.setContentAreaFilled(false);
sideBar.add(select);
Here's an image of the current result: