2
0

Java Client: Add mouse wheel support to combo boxes

This commit is contained in:
Michael Ziminsky (Z) 2018-10-29 11:07:55 -07:00
parent e925b10180
commit 2e5d3b32e8

View File

@ -482,6 +482,7 @@ public abstract class Components {
} );
putClientProperty( "JComboBox.isPopDown", Boolean.TRUE );
setAlignmentX( LEFT_ALIGNMENT );
addMouseWheelListener(e -> setSelectedIndex((getSelectedIndex() + e.getWheelRotation() + getItemCount()) % getItemCount()));
}
@Override