From a7aec873e6d630a4ff2d1a33ec12a54050c7b73d Mon Sep 17 00:00:00 2001 From: Eiren Rain Date: Mon, 5 Jul 2021 02:32:10 +0300 Subject: [PATCH] Added scroll bar to the main window --- src/main/java/io/eiren/gui/TrackersList.java | 2 -- src/main/java/io/eiren/gui/VRServerGUI.java | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/eiren/gui/TrackersList.java b/src/main/java/io/eiren/gui/TrackersList.java index 8067f5412..40cb3bc1f 100644 --- a/src/main/java/io/eiren/gui/TrackersList.java +++ b/src/main/java/io/eiren/gui/TrackersList.java @@ -11,7 +11,6 @@ import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JComboBox; import javax.swing.JLabel; -import javax.swing.border.BevelBorder; import com.jme3.math.FastMath; import com.jme3.math.Quaternion; @@ -20,7 +19,6 @@ import com.jme3.math.Vector3f; import io.eiren.util.StringUtils; import io.eiren.util.ann.AWTThread; import io.eiren.util.ann.ThreadSafe; -import io.eiren.util.ann.VRServerThread; import io.eiren.util.collections.FastList; import io.eiren.vr.VRServer; import io.eiren.vr.processor.TrackerBodyPosition; diff --git a/src/main/java/io/eiren/gui/VRServerGUI.java b/src/main/java/io/eiren/gui/VRServerGUI.java index ad0f9d0d5..8584d474d 100644 --- a/src/main/java/io/eiren/gui/VRServerGUI.java +++ b/src/main/java/io/eiren/gui/VRServerGUI.java @@ -7,7 +7,6 @@ import javax.swing.event.MouseInputAdapter; import io.eiren.util.ann.AWTThread; import io.eiren.vr.VRServer; -import java.awt.Container; import java.awt.event.MouseEvent; import java.util.TimerTask; @@ -21,6 +20,8 @@ public class VRServerGUI extends JFrame { private final SkeletonList skeletonList; private java.util.Timer timer = new java.util.Timer(); private JButton resetButton; + private JScrollPane scroll; + private EJBox pane; @AWTThread public VRServerGUI(VRServer server) { @@ -34,6 +35,8 @@ public class VRServerGUI extends JFrame { this.trackersList = new TrackersList(server, this); this.skeletonList = new SkeletonList(server, this); + add(scroll = new JScrollPane(pane = new EJBox(PAGE_AXIS), ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED)); + build(); } @@ -52,8 +55,6 @@ public class VRServerGUI extends JFrame { @AWTThread private void build() { - Container pane = getContentPane(); - pane.removeAll(); pane.add(new EJBox(LINE_AXIS) {{