blairacuda
Technical User
Hello Java Gurus,
I am new to Java and am playing around with popup menus. For some reason my menu item is throwing a compiler error.
Here is my Code:
1. JPopupMenu pm = new JPopupMenu();;
2. MenuItem mi = new MenuItem("Add");
3. mi.addActionListener(this);
4. mi.setActionCommand("add");
5. pm.add(mi); <-- This line is giving me an error
Error:
Cannot find symbol
symbol: method add(java.awt.MenuItem)
location: class javax.swing.JPopupMenu
I feel like it is something simple but can't figure it out...
Thanks in advance,
Chris
Chris Blair
Crystal, InstallShield, branching out in other programming realms.
I am new to Java and am playing around with popup menus. For some reason my menu item is throwing a compiler error.
Here is my Code:
1. JPopupMenu pm = new JPopupMenu();;
2. MenuItem mi = new MenuItem("Add");
3. mi.addActionListener(this);
4. mi.setActionCommand("add");
5. pm.add(mi); <-- This line is giving me an error
Error:
Cannot find symbol
symbol: method add(java.awt.MenuItem)
location: class javax.swing.JPopupMenu
I feel like it is something simple but can't figure it out...
Thanks in advance,
Chris
Chris Blair
Crystal, InstallShield, branching out in other programming realms.