hi, I have a question on my GUI design. I create a JTable to show the requested data, add a new column which allows the user to input the amount of seats he wants to book, and a button to update the data to db.db and refresh the JTable. The question is : after editing the cell, I have to move the cursor in order to fire the set value method of my table model, and save the data to a vector. if i don't do that(move the cursor) and just click the button, no data would be stored in the vector. Any suggestion?
You need to add a JTextBox as the table cell editor, add change listener to the JTextBox and update the Vector. But why? An easier design would be to provide a JTextBox outside the JTable. User can select a row and enter the seats in the JTextBox which is shown outside the JTable. This is easy compared to the current design and a junior programmer can understand!