You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2019/04/07 12:31:07 UTC

[lucene-solr] 27/34: Set scroll bar position to top of the pane.

This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch jira/lucene-2562-luke-swing-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit ad714e51ca12c3fa0cb44b2ce3c8d01a23252bfd
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sat Apr 6 20:03:53 2019 +0900

    Set scroll bar position to top of the pane.
---
 .../app/desktop/components/dialog/menubar/AboutDialogFactory.java    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
index 4f57c64..e9d9c97 100644
--- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
+++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/dialog/menubar/AboutDialogFactory.java
@@ -26,6 +26,7 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.ScrollPaneConstants;
+import javax.swing.SwingUtilities;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkListener;
 import java.awt.BorderLayout;
@@ -144,6 +145,10 @@ public final class AboutDialogFactory implements DialogOpener.DialogFactory {
     editorPane.addHyperlinkListener(hyperlinkListener);
     JScrollPane scrollPane = new JScrollPane(editorPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
     scrollPane.setBorder(BorderFactory.createLineBorder(Color.gray));
+    SwingUtilities.invokeLater(() -> {
+      // Set the scroll bar position to top
+      scrollPane.getVerticalScrollBar().setValue(0);
+    });
     return scrollPane;
   }