Mikael Saltzman wrote:2. Can I assign events and such to an anonymously added menuItem after it has been added to a menu?
Sure you can. Remember that you're adding a reference to the JMenuItem
object to the menu, not a reference to a variable. So if there's a JMenu method which returns that reference, then simply assign the reference to a local variable and do whatever you like with it. The fact that elsewhere in the program you assigned that reference to some other variable means nothing.