Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7834851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:21:29+00:00 2026-06-02T13:21:29+00:00

This is my first post to this forum, so if I screw something up,

  • 0

This is my first post to this forum, so if I screw something up, please let me know.

I have been using the information provided on this site for a good few months at this point to help me with various questions, so I thank you all for it the help!

Anyway, enough fluff and on to the question:
I am currently writing my first company-use program in the Java language and I have run into something for which I haven’t given much thought until last week.

Currently, I have created a program that uses two separate swing-type GUIs – one to log in a user and one that I am dubbing “the main GUI.” As with any language, there are multiple ways to achieve this and after much thinking about what the best way to do it is, I was wondering if anyone with experience had any insight as to the best practice for implementing multiple GUIs.

Right now, I have the login GUI’s action listener creating the main GUI object, but I do not think this is the best way to go about it (I’m sure some of the more seasoned Java programmers are probably cringing at the thought of creating a GUI object from an action listener – it’s like I can feel them wanting to smack the back of my head!).

So, to be direct – I have thought of about 3 different ways to acheive the objective, from recycling the JFrame to creating the GUI objects in main and setting visibility, and am wondering what the best practice (industry standard) is. Can anyone point me in the right direction?

I have posted this question to another group and was completely ignored. I am beginning to think there may not be a real answer to the question, but would like to try you experts at Stack Overflow before I give up. What are your thoughts? How have you implemented them in the past? Is better to instantiate them in main and manipulate visibility? While I have found posts that speak of best practices for creating a GUI, I haven’t seen much that speaks of multiple GUIs in the same program. Thanks for your time!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:21:37+00:00Added an answer on June 2, 2026 at 1:21 pm

    I believe what you did with the actionListener was overall okay to do, considering the first thing that appears is the log in screen. I’ve been in the same spot as you have and I’ve done 2 different things:

    1) I created them both and just changed the visibility. I linked the frames to my main frame, so I could grab data from all the other frames. So you could use this method if you’d like to use the data from the log in screen on your main JFrame.

    2) I used an actionListener to wait for the user to log in successfully, and on succession, the main GUI would be created.

    My opinion: I would go with method 1. It will allow you to use any of the JFrames to gather any necessary data. Also, it will provide the user with what GUIs were designed for, quick and easy access to whatever the project (or product) was created for. People don’t want to spend time waiting for each new JFrame they want to access load. It would be best to load the program all at once, so that it looks as if they GUI is operating at a fast speed, and provides results almost instantly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first post. I know this topic has been discussed before in
This is my first post on this forum (so please be gentle ) I'm
This is my first post on this forum. I have a question in regards
this is my first post on the forum. Here i have a javascript attempting
It's my very first post on this forum. I have stuck with the Microsoft
I have been reading this post on the codeigniter forum, http://codeigniter.com/forums/viewthread/174928/ and it has
This is my first post in any forum so please bear with me. I
this is my first post on this forum. So hi! I have a problem.
this is my first post to stack overflow! I'm using SlimDX for a game
This is my first post here. I have a problem. I need to take

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.