summaryrefslogtreecommitdiff
path: root/src/tesseract/newmenu/NewParticleMenuItem.java
diff options
context:
space:
mode:
authorPhillip <pacardon@u.washington.edu>2011-02-23 23:13:00 +0000
committerPhillip <pacardon@u.washington.edu>2011-02-23 23:13:00 +0000
commit9b1879614d5ce77db28c0e55a314dd075775b618 (patch)
treec827684edba19582b29d491f5626b2745311ac1d /src/tesseract/newmenu/NewParticleMenuItem.java
parent4245f4ac7475345162e484b79341cdff3b1710f4 (diff)
fixed an issue that caused multiple objects to appear PER parameter frame call.
One call would result in one object, adding a second object of the same type would then result in creating TWO more objects for a total of three, etc.
Diffstat (limited to 'src/tesseract/newmenu/NewParticleMenuItem.java')
-rw-r--r--src/tesseract/newmenu/NewParticleMenuItem.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tesseract/newmenu/NewParticleMenuItem.java b/src/tesseract/newmenu/NewParticleMenuItem.java
index 52aa1c2..9973b27 100644
--- a/src/tesseract/newmenu/NewParticleMenuItem.java
+++ b/src/tesseract/newmenu/NewParticleMenuItem.java
@@ -42,6 +42,7 @@ public class NewParticleMenuItem extends MenuItem {
super(theWorld, "Particle");
this.makePanel();
createParameterMenu();
+ makeListeners();
}
/**
@@ -59,6 +60,12 @@ public class NewParticleMenuItem extends MenuItem {
public void actionPerformed(final ActionEvent e) {
this.getParamFrame().pack();
this.getParamFrame().setVisible(true);
+ }
+
+ /**
+ * makeListeners and attach to buttons.
+ */
+ private void makeListeners() {
final JButton defaultButton = getDefaultButton();
final JFrame params = getParamFrame();
final JButton enterButton = getEnterButton();