public void actionPerformed(ActionEvent e){
JMenuItem jmi = (JMenuItem) e.getSource();
/* Because there are two text fields, we have to determine which invoked the popupmenu */
JFormattedTextField jftf = (JFormattedTextField) ((JPopupMenu) jmi.getParent()).getInvoker();
if(jmi.equals(cutMenuItem))
jftf.cut();
else if(jmi.equals(copyMenuItem))
jftf.copy();
else if(jmi.equals(pasteMenuItem))
jftf.paste();
else if(jmi.equals(selectAllMenuItem))