Jump to content
  • Advertisement
Sign in to follow this  
natebuckley

[java] JFrame

This topic is 3589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Thank you very much, just spent some time reading up on it but you answer helped greatly.

Thank you, I've opted to go for JFrames holding Panels at the moment.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!