If I use 2 editable JComboBoxes, the action command when typing
in some value in the editable part of the JComboBox for both of the
JComboBoxes is "comboBoxEdited":
((JComboBox) actionevent.getSource()).getActionCommand()
Changing the action command with setActionCommand() does not
change this.
How can I determine which JComboBox was changed?
thank you,
Erik
Chris Shepherd - 29 Dec 2003 00:22 GMT
> If I use 2 editable JComboBoxes, the action command when typing
> in some value in the editable part of the JComboBox for both of the
[quoted text clipped - 4 lines]
> change this.
> How can I determine which JComboBox was changed?
You can do this by comparing the object that getSource() returns to your
existing JComboBox object definition. Do something along the lines of:
if (actionevent.getSource().equals(cOne)) {
// etc
}
Where cOne represents the first combo box object.

Signature
Chris Shepherd