From 20d5178dd95672a430b1016858c25b5d17e3210e Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sun, 24 Nov 2024 15:35:16 +0100 Subject: [PATCH] fix: scroll to top of quest after the quest is selected I don't know of a better way to do this in Swing --- src/main/java/com/questhelper/panel/QuestHelperPanel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/questhelper/panel/QuestHelperPanel.java b/src/main/java/com/questhelper/panel/QuestHelperPanel.java index 69733eea6a..0e35703185 100644 --- a/src/main/java/com/questhelper/panel/QuestHelperPanel.java +++ b/src/main/java/com/questhelper/panel/QuestHelperPanel.java @@ -579,6 +579,8 @@ public void addQuest(QuestHelper quest, boolean isActive) questOverviewPanel.addQuest(quest, isActive); questActive = true; + SwingUtilities.invokeLater(() -> scrollableContainer.getVerticalScrollBar().setValue(0)); + repaint(); revalidate(); }