Question
1) Write the code for the 'Update' button . When the user clicks on a ROW in the JTable where the data is displayed, the
1) Write the code for the 'Update' button. When the user clicks on a ROW in the JTable where the data is displayed, the data from that row should be displayed in the Text boxes on the left. The user will then make changes in the Textboxes and click the 'Update' button to update the DVD Table. Clicking the 'Load Table' button should display the updated table data.
2) Write the code for the 'Delete' button. When the user clicks on a ROW in the JTable where the data is displayed, the data from that row should be displayed in the Text boxes on the left. The user will then click the 'Delete' button to delete the clicked row from the DVD Table. Clicking the 'Load Table' button should display the table data with the row deleted.
This is the code I have so far but the code for insert is not working.
Please have it written in Java, I am using eclipse.
JButton btnLoad new JButton (C" Load Table btnLoad addAction Listener new Action ListenerO 1 public void action Performed ActionEvent e) try String query Select from DVD Prepared Statement pStatement conn prepare Statement query ResultSet rset pStatement. execute QueryO table.setModel CDbUtils. resultSetToTableModelCrSet)); Set. Close CD; //conn .close catch CException e2) 1 JOptionPane showMessageDialogGnull, Error loading table")Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started