Swing не инициирует mouseEntered/mouseExited правильно после событий колесика мыши?

Взгляните в syslogins или sysusers таблицах в основной схеме. Не уверенный, если это все еще все еще вокруг в более свежих версиях MSSQL все же. В 2005 MSSQL существуют представления, названные sys.syslogins и sys.sysusers.

6
задан Glorfindel 10 May 2019 в 16:04
поделиться

2 ответа

Это похоже на проблему, аналогичную описанной в Всплывающие подсказки и области прокрутки . То есть события мыши не генерируются, потому что сама мышь не двигается, а область просмотра перемещается. Я не уверен в точном решении, кроме использования AdjustmentListener для отслеживания компонента в местоположении мыши. При каждом изменении вы можете запускать событие mouseExited для предыдущей панели и событие mouseEntered для новой панели.

5
ответ дан 16 December 2019 в 21:41
поделиться

I can get your code to reproduce this reliably but only when I don't quite finish the scrolling. On my mouse at least there is sort of a "catch" when the mouse wheel finished scrolling. If I scroll very slowly I can have it move but it doesn't change the highlight until the mouse wheel has reached the "catch".

When I do that the mouse enter message is received on the previous panel (same behaviour you are seeing).

Looking at it I scroll the mouse and it does not actually receive the exited/entered events unless I scroll enough to have the mouse wheel "catch". It is possible that Windows does not send the message to Java until the "catch" happens... from my testing that is what it looks like.

You might want to look into the MouseWheelListener interface and the MouseInfo class. I guess you might be able to detect the wheel movement and then figure out where you are with MouseInfo.getPointerInfo().getLocation() and then figure out what component you are over and change the highlighting.

3
ответ дан 16 December 2019 в 21:41
поделиться
Другие вопросы по тегам:

Похожие вопросы: