From 2e5d3b32e87b38a6972cfbefea2531faf8fd6026 Mon Sep 17 00:00:00 2001 From: "Michael Ziminsky (Z)" Date: Mon, 29 Oct 2018 11:07:55 -0700 Subject: [PATCH] Java Client: Add mouse wheel support to combo boxes --- .../main/java/com/lyndir/masterpassword/gui/util/Components.java | 1 + 1 file changed, 1 insertion(+) diff --git a/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Components.java b/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Components.java index 1b1d80f8..22431784 100644 --- a/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Components.java +++ b/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Components.java @@ -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