7 Years
Discussion Span
Last Post by Taywin

The link won't explain in depth about how to deal with button on JTable, believe me. I worked on it before. It shows you how to display a button, but the button itself does not work as a button. You need to add a listener to the button yourself because the JTable does not pass the event to the rendered button. And then a lot of complicated things could go on depending on how complex your table is... One way to do it is to render a table cell as a button, and then add action listener to it. There are examples floating around on the Internet, but not all work. You should google for "add button to JTable." You should see some links that could lead to a solution (I did a while back ago).

Edited by Taywin: n/a


hmmm, maybe I understood how you are ...., sure there are exist JTable, MouseListener, ActionListener, but ...please not (at all) renderer, but TableCellRenderer, and if you want ... works then you have to overRide TableCellEditor too, maybe is there something else that you are missing Focus is asynchronous, btw just invokeLater can solved your ...


That's the way I did by render a whole cell table as a button and override the TableCellEditor in order to ensure that the event is accepted when a user click on the button (cell). :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.