I have 2 button and they are the same model. I want to mouse hover a button, another button is highlight. It 's OK. But, when I click a button, the listener of 2 buttons is active. How to active listener of the button that is clicked ?
Jbutton A, B;
A.addActionListener(lnA);
B.addActionListener(lnB);
ButtonModel bm = previewButton.getModel();
arrow.setModel(bm);