Mouse over events with JButton
java, jbutton, swing
Solution
for Icon to use implemented methods in API
you can to use ButtonModel with ChangeListener
(by default) for JButtons JComponents there no reason to use `Mouse(Xxx)Listener` or its `MouseEvent`, all those events are implemented and correctly
Problem
I'm trying to create a custom mouse over event on a JButton. The reason being that my JButton is currently an image, so I had to remove all the borders and animations and what not. so I did this: ``` btnSinglePlayer.setOpaque(false); btnSinglePlayer.setContentAreaFilled(false); btnSinglePlayer.setBorderPainted(false); ``` And that works perfect to only display the image, and the button does in fact work. I want to know if there's any pre-built methods perhaps that can do this, or how I would go about learning to do what I want. More specifically, what I want the image to do when I mouse over is for it to get just a bit bigger. I have tried these so far, and did nothing: ``` btnSinglePlayer.setRolloverIcon(singlePlayerButton); btnSinglePlayer.setPressedIcon(singlePlayerButton); ```