Passbook 2
Passbook 2
*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.sql.*;
Container c = getContentPane();
c.setLayout(new BorderLayout(20, 20));
c.add(topPanel, BorderLayout.NORTH);
c.add(scrollPane, BorderLayout.CENTER);
c.add(bottomPanel, BorderLayout.SOUTH);
while (rs.next())
{
String s1 = rs.getString("date");
String s2 = rs.getString("description");
double d1 = rs.getDouble("amount");
double d2 =rs.getDouble("balance");
tableModel.addRow(new Object[]{s1,s2,d1,d2});
}
}
}
catch (Exception e)
{
JOptionPane.showMessageDialog(null,e.getMessage());
}
setTitle("Passbook");
setSize(800, 550);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}