From d379f8e548b3d0ee5d0f6db291415c96cd993351 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 8 Sep 2011 11:14:50 +0100 Subject: Modified PunchingBagGUI to fix the sim bag on smaller screens (my laptop), this needs to be fix properly so that the bag expands, but keeps its aspect ratio. --- PunchingBag/src/PunchingBagGUI.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PunchingBag/src/PunchingBagGUI.java b/PunchingBag/src/PunchingBagGUI.java index 91d223a..19385f5 100644 --- a/PunchingBag/src/PunchingBagGUI.java +++ b/PunchingBag/src/PunchingBagGUI.java @@ -53,7 +53,7 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener, Butto } PunchingBagGUI() throws InterruptedException { - bag.buttonArduino.listPorts(); + //bag.buttonArduino.listPorts(); frame = new JFrame("Punching Bag GUI"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -81,6 +81,8 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener, Butto bottomTopSplitPane.setBottomComponent(new SerialPanel()); frame.add(bottomTopSplitPane, BorderLayout.CENTER); + + //frame.pack(); } class SerialPanel extends JPanel implements ActionListener { @@ -339,7 +341,7 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener, Butto } public Dimension getPreferredSize() { - return new Dimension(10, 10); + return new Dimension(5, 5); } public void paintComponent(Graphics g) { @@ -375,7 +377,7 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener, Butto } public Dimension getPreferredSize() { - return new Dimension(30, 30); + return new Dimension(20, 20); } public void paintComponent(Graphics g) { -- cgit v1.2.3