From dcfab1533fc634c3bc10140e7d45f1207042bdef Mon Sep 17 00:00:00 2001 From: Phillip Date: Sun, 6 Mar 2011 21:39:01 +0000 Subject: Added code to allow setting relative position to Parent (Tesseract UI) --- src/tesseract/newmenu/MenuItem.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/tesseract/newmenu/MenuItem.java') diff --git a/src/tesseract/newmenu/MenuItem.java b/src/tesseract/newmenu/MenuItem.java index c47aa2c..6507b52 100644 --- a/src/tesseract/newmenu/MenuItem.java +++ b/src/tesseract/newmenu/MenuItem.java @@ -49,7 +49,7 @@ public abstract class MenuItem extends JMenuItem implements ActionListener { /** * Jframe to hold panel. */ - private JFrame myFrame; + //private JFrame myFrame; /** * Jpanel for variable text boxes. */ @@ -103,7 +103,7 @@ public abstract class MenuItem extends JMenuItem implements ActionListener { public MenuItem(final World theWorld, final String theLabel) { super(theLabel); useColorButton = true; - myFrame = new JFrame(); + //myFrame = new JFrame(); myParameters = new HashMap(); myPanel = new JPanel(); myReadData = new HashMap (); @@ -261,4 +261,12 @@ public abstract class MenuItem extends JMenuItem implements ActionListener { protected float getMass() { return ((Float) myParameters.get("Mass")).floatValue(); } + + /** + * Set Parent + * @param theParent frame. + */ + public void setParent (final JFrame theParent) { + myParamFrame.setLocationRelativeTo(theParent); + } } -- cgit v1.2.3