E
E
ErickSkrauch2014-08-27 12:37:23
Java
ErickSkrauch, 2014-08-27 12:37:23

How to check if the mouse is hovered over a JPanel?

You need to somehow check that after the mouseReleased event, the mouse remains on the panel or behind it. I looked through Debug for some values ​​​​that I can catch on to, but I didn’t notice anything sensible. Mb any ideas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
ErickSkrauch, 2014-08-27
@ErickSkrauch

I found a solution: you need to declare a boolean variable in which to write states on the mouseEntered and mouseExited events, and in mouseReleased look at this variable and, depending on its value, perform actions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question