Here you can find the source of aplicarMenu(JMenuItem loMenuO, JMenuItem loMenuD)
private static void aplicarMenu(JMenuItem loMenuO, JMenuItem loMenuD)
//package com.java2s; //License from project: Open Source License import java.awt.event.ActionListener; import javax.swing.JMenuItem; public class Main { private static void aplicarMenu(JMenuItem loMenuO, JMenuItem loMenuD) { loMenuD.setText(loMenuO.getText()); loMenuD.setIcon(loMenuO.getIcon()); loMenuD.setMnemonic(loMenuO.getMnemonic()); loMenuD.setVisible(loMenuO.isVisible()); ActionListener[] lo = loMenuO.getListeners(ActionListener.class); ActionListener[] loD = loMenuD.getListeners(ActionListener.class); for (int i = 0; i < loD.length; i++) { loMenuD.removeActionListener(loD[i]); }//from w w w . ja v a 2s. c om for (int i = 0; i < lo.length; i++) { loMenuD.addActionListener(lo[i]); } } }