summaryrefslogtreecommitdiff
path: root/src/tesseract/newmenu/MenuItem.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/tesseract/newmenu/MenuItem.java')
-rw-r--r--src/tesseract/newmenu/MenuItem.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/tesseract/newmenu/MenuItem.java b/src/tesseract/newmenu/MenuItem.java
index 6507b52..67f729a 100644
--- a/src/tesseract/newmenu/MenuItem.java
+++ b/src/tesseract/newmenu/MenuItem.java
@@ -96,6 +96,11 @@ public abstract class MenuItem extends JMenuItem implements ActionListener {
private boolean useColorButton;
/**
+ * Parent frame
+ */
+ private JFrame myParent;
+
+ /**
* Constructor.
* @param theWorld world parameter.
* @param theLabel for menu item.
@@ -116,6 +121,7 @@ public abstract class MenuItem extends JMenuItem implements ActionListener {
myParamFrame.setLayout(new BorderLayout());
myColorButton = new JButton("Color");
myColor = Color.RED;
+ myParent = new JFrame();
}
/**
@@ -263,10 +269,18 @@ public abstract class MenuItem extends JMenuItem implements ActionListener {
}
/**
- * Set Parent
+ * Set Parent.
* @param theParent frame.
*/
- public void setParent (final JFrame theParent) {
+ public void setParent(final JFrame theParent) {
myParamFrame.setLocationRelativeTo(theParent);
+ myParent = theParent;
+ }
+
+ /**
+ * Set Parent.
+ */
+ public void setParent() {
+ myParamFrame.setLocationRelativeTo(myParent);
}
}