TabbedPane: disable wheel scrolling if application has added its own mouse wheel listener (PR #187)

This commit is contained in:
Karl Tauber
2020-11-01 16:22:05 +01:00
parent 9b8df64c35
commit 1a31cb96b8

View File

@@ -1594,6 +1594,10 @@ public class FlatTabbedPaneUI
@Override
public void mouseWheelMoved( MouseWheelEvent e ) {
// disable wheel scrolling if application has added its own mouse wheel listener
if( tabPane.getMouseWheelListeners().length > 1 )
return;
// because this listener receives mouse events for the whole tabbed pane,
// we have to check whether the mouse is located over the viewport
if( !isInViewport( e.getX(), e.getY() ) )