class ActionPerformedMenuBar implements ActionListener{ public void actionPerformed(ActionEvent e){ // this is for the Edit Menu Items - Copy and Paste - to work double storeValue; storeValue = 0; if(e.getSource() == jmenuitemCopy){ storeValue = Double.parseDouble(getDisplayString()); } if(e.getSource() == jmenuitemPaste){ setDisplayString(Double.toString(storeValue)); } }