Hy again ,
I have another problem now ,
I have an application with a jTabel , you can double click a cell and you can change the value that is inside it , after you changed the value inside the cell and hit enter the value i enterd remains but i need to hit again enter key to return me the row and column that i need to save later in the database.
My question :
How can i save the data from the cell after editing was done without needing to hit ENTER key again?
My code is this but it does not work :
private void jTable2KeyPressed(java.awt.event.KeyEvent evt) {
// TODO add your handling code here:
if(evt.getKeyCode() == evt.VK_ENTER){
DefaultTableModel model = (DefaultTableModel) this.jTable2.getModel();
int row = jTable2.getSelectedRow();
int column = jTable2.getSelectedColumn();
Object value2 = model.getValueAt(row , column);
System.out.println(value2);
}
}