Skip to content

Commit ab77e30

Browse files
authored
Merge pull request #6377 from IllianiCBT/immersiveDialogScroll
Fixed Scroll Pane Starting Position In Immersive Dialogs
2 parents 3ade219 + ea9ffb7 commit ab77e30

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

MekHQ/src/mekhq/gui/baseComponents/immersiveDialogs/ImmersiveDialogCore.java

+2
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ private JPanel createCenterBox(String centerMessage, List<ButtonLabelTooltipPair
285285
JScrollPane scrollPane = new JScrollPane(editorPane);
286286
scrollPane.setMinimumSize(new Dimension(CENTER_WIDTH, scrollPane.getHeight()));
287287
scrollPane.setBorder(BorderFactory.createEmptyBorder());
288+
// This line ensures the scroll pane starts scrolled to the top, not bottom.
289+
SwingUtilities.invokeLater(() -> scrollPane.getViewport().setViewPosition(new Point(0, 0)));
288290

289291
// Create a container with a border for the padding
290292
JPanel scrollPaneContainer = new JPanel(new BorderLayout());

0 commit comments

Comments
 (0)