> I have a popup menu which shows itself when I right click over a
> JTextArea called taLocations. I can use the menu with the following
[quoted text clipped - 23 lines]
> }
> };
There are many ways to do this. The most straight forward might be to
make your ActionListener a named class and add an attribute to hold the
name of the text area. Then when the menu pops, it is responsible for
setting the attribute. You could also have the attribute on the pop-up
menu object.
Alternatively you could use different instances of pop-up menu and
listeners that already know what text area they are associated to.
HTH,
Ray

Signature
This signature intentionally left blank.
google@aikempshall.freeserve.co.uk - 25 Jan 2006 14:19 GMT
Thanks. I've gone for the different instances of pop-up menu and
listeners. Like so -
ActionListener menuListenerSkills = new ActionListener() {
public void actionPerformed(ActionEvent event) {
if (event.getActionCommand().equalsIgnoreCase("Save"))
{
}
if
(event.getActionCommand().equalsIgnoreCase("Restore")) {
}
}
};
itemSkills.addActionListener(menuListenerSkills);
popupSkills.setLabel("Justification");
popupSkills.setBorder(new BevelBorder(BevelBorder.RAISED));
taSkills.addMouseListener(new OpenSeatViewer().new
skillsMousePopupListener());
Thanks