There are two methods for adding Action into JMenu and JPopupMenu:
1. JMenuItem add(new JMenuItem(Action))
2. JMenuItem add(Action)
In second case we create anonymous subclass of JMenuItem.
But java.beans.XMLEncoder could not persist properly this JMenuItem because it isn't JavaBean: there are no public empty constructor. And XMLEncoder (and XMLDecoder) could not create instance of private anonymous class.
Could you implement method add(Action) as simple shortcut to method add(new JMenuItem(Action))?