Advertisement
Guest User

Untitled

a guest
Oct 5th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. JButton btnLoad = new JButton("Load Games");
  2. btnLoad.addActionListener(new ActionListener() {
  3. public void actionPerformed(ActionEvent e) {
  4. try
  5. {
  6. DriverManager.getConnection("jdbc:mysql://localhost:3306/tupaness","root","");
  7. Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/tupaness","root","");
  8. PreparedStatement ps = conn.prepareStatement("select * from games where genre = 'racing'");
  9. ResultSet rs = ps.executeQuery();
  10. table.setModel(DbUtils.resultSetToTableModel(rs));
  11. }catch(Exception error)
  12. {
  13. JOptionPane.showMessageDialog(null, error);
  14. }
  15. }
  16. });
  17.  
  18. JButton btnCheckout = new JButton("Checkout");
  19. btnCheckout.addActionListener(new ActionListener() {
  20. public void actionPerformed(ActionEvent arg0) {
  21. racingUsr.setVisible(false);
  22.  
  23. for(int rcount=50;rcount<table.getRowCount();rcount--){
  24. }
  25.  
  26. }
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement