I have a question regarding building GUI applications. I feel like the title of this question is not really accurate but I could not think of a better one.
What is the proper way of building the application? Should I just create one JFrame, then change the panels in that JFrame as needed? Or should I always create new JFrame and get rid of the old one when moving from one thing to another?
For example, I have the JFrame containing a JPanel that has few text fields and JLabels. User enters username and password, clicks a login button to continue. Should a completely new JFrame appear, or should a new JPanel be created instead, using the old JFrame?
Depends, but often it’s better if you can reuse the same window. Often, you might want to use a JDialog / JOptionPane to handle login. Dialog windows are meant to be more disposable