I am new to GUI Creation and having the following problem:
I have a main class: AppWindow.java containing a JFrame.
If a Button is pressed the class new.java which extends JPanel is added to the upper JFrame. Working fine so far.
The problem now is, that the JPanel should be removed, when a Button in JPanel is pressed. How can I do that?
My Idea: The JFame must somehow listen to the JPanel, whether it may be removed.
Thank you!