I wrote my own table cell editor that extends an AbstractCellEditor and implements a TableCellEditor, an ItemListener, and a MouseListener. Is there a way I can have the mouseClicked method be executed first before the itemStateChanged method? I'm trying to do the following:
private int rowClicked;
private JTable table;
public void itemStateChanged(ItemEvent e) {
if (rowClicked == 5) {
// Do something to row 5.
}
}
public void mouseClicked(MouseEvent e) {
Point p = e.getPoint();
rowClicked = table.rowAtPoint(p);
}
Here is a nice article explaining the absence of listener notification order in swing: Swing in a better world
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With