Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Write the code for the 'Update' button . When the user clicks on a ROW in the JTable where the data is displayed, the

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago