Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here we have a gui that is integrated with a Shipping management database ( both java gui and mysql code given in files), when you

Here we have a gui that is integrated with a Shipping management database ( both java gui and mysql code given in files), when you run the gui in java you can choose from four entites from the database to do the following queries (INSERT, DELETE, DISPLAY). The proplem is we can't seem to get the DISPLAY method working, we're not sure whats the cause. If someone could check the java code and help us find the problem and fix it so the gui works flawlessly.

i think the proble is in this method //image text in transcribedpublic JTable ResultRet(ResultSet rs) throws SQLException

//Creates JTable of the resultset public JTable ResultRet(ResultSet rs) throws SQLException { ArrayList columnNames = new ArrayList(); ArrayList> data = new ArrayList>(); ResultSetMetaData md = rs.getMetaData(); int columns = md.getColumnCount();

// Get column names for (int i = 1; i

// Get row data while (rs.next()) { ArrayList row = new ArrayList(columns);

for (int i = 1; i

data.add( row ); } Vector columnNamesVector = new Vector(); Vector> dataVector = new Vector();

for (int i = 0; i

for (int i = 0; i

//create a new GUI form with tables public void newFrame(boolean frameFlag) { TableFrame = new JFrame("Shipment Management System");

Container tContainer = TableFrame.getContentPane();

tContainer.setBackground(Color.cyan); tContainer.setLayout(null); font = new Font("Lemon",Font.BOLD,32);

l3 = new JLabel("Shimpent Management System"); l3.setFont(font); table = new JTable(); table.getTableHeader().setFont(new Font("Segeo UI",Font.BOLD,12)); table.getTableHeader().setOpaque(false); table.getTableHeader().setBackground(new Color(32,136,203)); table.getTableHeader().setForeground(new Color(255,255,255)); table.setRowHeight(25); table.setAutoCreateColumnsFromModel(true); table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);

JScrollPane scrollPane = new JScrollPane(table); scrollPane.setBounds(1,80,1110,250); try{ for(UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if("Windows".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch(Exception ex) { ex.getMessage(); } tContainer.add(l3); tContainer.add(scrollPane);

back = new JButton("Back"); back.setBounds(450,350,70,40); tContainer.add(back);

back.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { TableFrame.setVisible(false); LoginForm(); } });

TableFrame.setVisible(frameFlag); TableFrame.setBounds(150,100,1127,430); }

2213 94214 Vector columnNamesVector = new Vector(); Vector> dataVector = new Vector(); 1 Shipment Management System Back 243 @ Javadoc Search 2 Console X Debug Coverage

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

Step: 3

blur-text-image

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

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

Do you consider yourself introspective?

Answered: 1 week ago

Question

Different formulas for mathematical core areas.

Answered: 1 week ago