diff options
author | Phillip <pacardon@u.washington.edu> | 2011-03-06 21:39:01 +0000 |
---|---|---|
committer | Phillip <pacardon@u.washington.edu> | 2011-03-06 21:39:01 +0000 |
commit | dcfab1533fc634c3bc10140e7d45f1207042bdef (patch) | |
tree | dbf4f00c387f6330efafcf4d03e0af321c380aaf /src/tesseract/newmenu | |
parent | cb7655829b7c69030d9a24fbd4308b06e2b55670 (diff) |
Added code to allow setting relative position to Parent (Tesseract UI)
Diffstat (limited to 'src/tesseract/newmenu')
-rw-r--r-- | src/tesseract/newmenu/MenuItem.java | 12 |
1 files changed, 10 insertions, 2 deletions
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<String, Object>();
myPanel = new JPanel();
myReadData = new HashMap <String, JTextField>();
@@ -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);
+ }
}
|