List of usage examples for javax.swing JMenuItem addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
From source file:Main.java
/** * Forces slave menu item to reflect master menu item using a property change * listener./* w w w .jav a 2s . c o m*/ */ protected static void linkMenuItem(final JMenuItem master, final JMenuItem slave) { final JMenuItem source = master, dest = slave; source.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(final PropertyChangeEvent e) { syncMenuItem(source, dest); } }); }