I'm just starting out with Swing - I'm sorry if this question is hard to understand, but I feel it is a very simple thing, but in Swing it seems surprisingly difficult.
I have a panel with two text fields and a submit button.
I added a listener to the submit button when he clicked. I check data etc.
Now I want the frame to display a new panel - get rid of the current panel with text fields and the submit button and create a new instance based on the data entered in the text fields.
How can I send this data back to the frame, so that the frame can delete the current panel and replace it with a new, different panel created using data from the first panel.
Although this is not what I am doing, it could be called as a login.
Show login panel The panel receives a username and password, verifies (verification can be performed above) If this is confirmed, replace the login panel with the real content panel
This is unexpectedly hard to understand in Swing. Should I define my own type of event and make the frame a listener for this event?
source share