diff options
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 |