From 47693e1bb604f2ee26aa2f415f101f4a4e53032d Mon Sep 17 00:00:00 2001 From: Area128 Date: Tue, 18 Dec 2018 13:57:29 +0100 Subject: [PATCH] Add vertical scroll bar to config window. Helps if you have too many fields. --- Telemetry Viewer/src/ConfigureChartWindow.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Telemetry Viewer/src/ConfigureChartWindow.java b/Telemetry Viewer/src/ConfigureChartWindow.java index f6c78a3..fcb699f 100644 --- a/Telemetry Viewer/src/ConfigureChartWindow.java +++ b/Telemetry Viewer/src/ConfigureChartWindow.java @@ -25,7 +25,8 @@ public ConfigureChartWindow(JFrame parentWindow, PositionedChart chart) { JPanel windowContents = new JPanel(); windowContents.setBorder(new EmptyBorder(10, 10, 10, 10)); windowContents.setLayout(new BoxLayout(windowContents, BoxLayout.Y_AXIS)); - add(windowContents); + JScrollPane scrollPane = new JScrollPane(windowContents, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); //Let all scrollPanel has scroll bars + add(scrollPane); JPanel doneButtonPanel = new JPanel(); JButton doneButton = new JButton("Done"); @@ -46,9 +47,9 @@ public ConfigureChartWindow(JFrame parentWindow, PositionedChart chart) { windowContents.add(doneButtonPanel); // size and position the window - setResizable(false); + setResizable(true); pack(); - setSize((int) (getWidth() * 1.3), getHeight()); + setSize((int) (getWidth() * 1.3), (int) (getWidth() * 1.3)); setLocationRelativeTo(parentWindow); setModal(true);