java file in a same package. Its bus booking system, one is Reservation.java that has the program and the other is JPanel.java GUI. My problem is: I wanna increase counter in Main.java by pressing button in JPanel.java
Main.java
public static void main(String args[]) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
frame.getContentPane().add(panel);
JPanel.java
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
BookWindow window = new BookWindow(); //not working
i++;
}
Thank you <3