Of course it can be done in Java; in the actionPerformed( ... ) method of your, say, CopyMenuItem all you have to do is this:



public void actionPerformed(ActionEvent ae) {

// assuming...