B
Ben
Hi, can anyone help with this?
At the moment I have a class that implements ActionListener and
overides the method actionPerformed (ActionEvent e).
I have a number of JButtons that have the custom listener
added to them using addActionListener(customListener). In order to
find out which button was pressed I attach an action command to them
using setActionCommand("text"). I then use getActionCommand() in the
custom listener class to find out which button was pressed. This works
great for buttons. But I have a JComboBox that contains a number of
values. How can I do a similar thing and find out what value was
selected in the combobox from the listener?
Thanks in advance for any help.
Ben.
At the moment I have a class that implements ActionListener and
overides the method actionPerformed (ActionEvent e).
I have a number of JButtons that have the custom listener
added to them using addActionListener(customListener). In order to
find out which button was pressed I attach an action command to them
using setActionCommand("text"). I then use getActionCommand() in the
custom listener class to find out which button was pressed. This works
great for buttons. But I have a JComboBox that contains a number of
values. How can I do a similar thing and find out what value was
selected in the combobox from the listener?
Thanks in advance for any help.
Ben.