I need to create a GUI for a program with a panel to login that will show the real software after the login is set.
So the question is:
Should i create two frames and show the first for login and the second for program? Or is better to add two different panels and hide the login when the program starts?
This is a little subjective. For me, it would come down to how complex the application is and whether you would need to support multiple sessions and if those sessions shared a single frame or not.
If you application relative simple (has one or two views for example), I’d consider it acceptable use something like a
CardLayoutand simply show the login pane within the main application frame, when the user is successfully authenticated, switch to the main view.If the application is more complex, I’d consider using a separate dialog.
Even if you’re allowing the user to have multiple sessions, it would come down to how complex the actual application is (IMHO) as to whether I would use a separate dialog or not.
I’d also consider if the user can do anything before they login, for example, can they update settings? If so, using a panel would be suitable as the login dialog is most likely going to be modal.