I was just wondering how to get this JButton "nextButton" to work. It is used by the actionPerformed method for the e.getSource instanceof JButton. How can I make it to work alone?
if(e.getSource() == nextButton){
try {
stmt.executeUpdate("UPDATE seats SET type = 'booked' WHERE seatNum = 3");
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
if(e.getSource() instanceof JButton){
bookedIcon = new ImageIcon("images/bookedSeat.png");
int a = Integer.parseInt(e.getActionCommand());
int seat = a;
a =- 1;
seatsA[a].setIcon(bookedIcon);
}