How can I do a "mouse out" effect in Java?
I'm trying to mouse over a JBut开发者_开发问答ton (javax.swing.JButton) and set the border color, Now I can get this to work I with a mouse move event on the button, I just need to mouse out and I can't seem to find a way to get a mouse out effect to work. Any ideas or methods that could help? Note: MouseExited does not work. At least in my instance.
What about a "mouse over" on the buttons parent Component? Set a flag if the mouse is over the button and if it is over the parent (surrounding) panel and the flag is set, you have something like "mouse out".
Using the mouseExisted method is the way to achieve this effect. If you are having trouble with it, then it is a problem in your code, but you are going down the right path.
精彩评论