diff options
| author | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
|---|---|---|
| committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
| commit | 1c5e38fe69ac8a6decbdd8abe93112f4e3369315 (patch) | |
| tree | 926cef8cb76d46862ed2c4ec7028720611e47476 /src/Menu.java | |
| download | Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.gz Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.bz2 Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.zip | |
added source
Diffstat (limited to 'src/Menu.java')
| -rw-r--r-- | src/Menu.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Menu.java b/src/Menu.java new file mode 100644 index 0000000..b741aaf --- /dev/null +++ b/src/Menu.java @@ -0,0 +1,32 @@ +/* */ import java.awt.event.ActionEvent; +/* */ import java.awt.event.ActionListener; +/* */ import javax.swing.AbstractButton; +/* */ import javax.swing.JComponent; +/* */ import javax.swing.JMenu; +/* */ +/* */ public class Menu extends JMenu +/* */ implements ActionListener +/* */ { +/* */ private JComponent[] comps; +/* */ +/* */ public Menu(String name, JComponent[] args) +/* */ { +/* 14 */ super(name); +/* 15 */ this.comps = args; +/* 16 */ for (int i = 0; i < args.length; i++) { +/* 17 */ add(args[i]); +/* 18 */ if ((args[i] instanceof AbstractButton)) +/* 19 */ ((AbstractButton)args[i]).addActionListener(this); +/* */ } +/* */ } +/* */ +/* 23 */ public JComponent get(int x) { return this.comps[x]; } +/* */ public void actionPerformed(ActionEvent e) { +/* 25 */ for (int i = 0; i < getActionListeners().length; i++) getActionListeners()[i].actionPerformed(e); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: Menu + * JD-Core Version: 0.6.2 + */
\ No newline at end of file |