I am writing a program in Java with Java Swing. I have a class, which is a custom JPanel (my class extends JPanel), which is a log in page. The panel contains a button called "Enter".
When I create my main JFrame, I add the Log in Panel in it. When the button "Enter" is pressed I want to remove the Log In panel and proceed to the next panel.
So how can I make my frame understand when the button "Enter" from the Log In panel is pressed (they are in different classes), so that it proceeds to the next page?