Sign in to follow this  
natebuckley

[java] JFrame

Recommended Posts

Hello, having a little play after not touching Java for a few months and I'm just wondering something (I hope I've worded the following correctly) Is JFrame the main holder for all the other things going on? What I mean by "things" is I have a basic log in screen (I think this will be stored on a JPanel??) then I click a button and the JFrame will stay but it will load a new JPanel containing the next screen, is this a correct assumption, or is there something that is meant to hold different JFrames. Thanks for any help thrown my way. Nate

Share this post


Link to post
Share on other sites
If understood correctly, your question does not have a distinct answer, but I try to give some possibilities:

A JFrame is not necessary the only container for everything in your program. A program itself can contain several Frames, Panels, Dialogs etc. as long as it manages them.
If you would like to have several Frames in a Frame you could use a DesktopPane and integrate JInternalFrames into it.
If you would like to make a login screen, this can be done in different ways. You could either open a Dialog at the beginning and if checked as correctly open the MainFrame Surface or something like that. You could also do a login as an InternalFrame and change the contentpane accordingly if logged in or something.

Maybe Google for Internal Frames or the overall Sun Java Swing tutorials to get an idea about how to manage windows.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this