I have this ComboBox which I want to fire a selected option upon runtime, I know to fire a button action by using button.doClick(), but how can I do this in a ComboBox action event?
This is my ComboBox event:
comboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if(filters.isEmpty())
filters.add(RowFilter.regexFilter(comboBox.getSelectedItem().toString(), 2));
else
filters.set(0, RowFilter.regexFilter(comboBox.getSelectedItem().toString(), 2));
// Apply filters
sorter.setRowFilter(RowFilter.andFilter(filters));
/* comboBox.setSelectedItem("BAR");*/
}
});