3

I'm a student, intrested in Java programming. Now im trying to create user interactive form.

Untill now, I have created a form view, using swing components, JLable, JTextfield where user enters data. JButtons, 'new' 'save' 'delete' 'edit', which listens user action through ActionListner.

A table that 'extends' AbstractTableModel. Table values are the ResultSet values. i have used MySQL connectivity.

Table is displayed. User can now add new row to it, using 'New' and 'Save' button. Please watch this

enter image description here

My problem is, i need the corresponding TextFields to display the corresponding row user selects in the displayed table, so that 'edit' and 'delete' would be user interactive. users are allowed to select table's row. Need Help.

Im sorry if any mistake in my question format and language. Thank you!

2 Answers 2

1

on row select event, populate the values of text fields with tables selected row values.

Sign up to request clarification or add additional context in comments.

Comments

1

As discussed in How to Use Tables, JTable will supply a default editor for any cell in your TableModel that returns true from isCellEditable(). Just double click on the cell. See also User Selections for more on selection listeners.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.