• Post Reply Bookmark Topic Watch Topic
  • New Topic

Scroll in viewport when mouse is over a Popup?

 
Janus Engstrøm
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi fellow ranchers!

I have a JDialog with a JScrollPane (using all available space in the JDialog), which has a default viewport. To that JScrollPane I have added a MouseWheelListener.
I have several javax.swing.Popup windows over that JScrollPane, which unfortunately results in the MouseWheelEvent not being fired, when the mouse hoovers one of those Popups.

How can I get the MouseWheelEvent to fire, even when the mouse is over one of these Popups?

It would also work (even better!) if the JScrollPane is being scrolled no matter where the mouse pointer is placed on screen as long as the JDialog has focus?


With kindest regards,
Janus
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Retrieve the vertical scroll bar from the JScrollPane, and set its value based on the old value and the amount of scrolling.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!