I have a jTable which currently displays and allows editing of a database table, I am now trying to sort adding tuples.
I am trying to get it to automatically add a row on downarrow at the bottom. So if I am at the bottom on the table and click my down arrow a new row will appear below. I just can’t figure out how to do it.
Thanks
James
Action handling of
JTablehappens injavax.swing.plaf.basic.BasicTableUI. In your case, you probably need to register a new action forSCROLL_DOWN_CHANGE_SELECTION. In the action, check whether the current selection == last row of the table.If that doesn’t work, set a breakpoint in
javax.swing.plaf.basic.BasicTableUI.Actions.actionPerformed(ActionEvent)to see which action is really executed.