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

  • Home
  • SEARCH
  • 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 8940659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:05:37+00:00 2026-06-15T11:05:37+00:00

I have been developing command line programs in Java for a while now and

  • 0

I have been developing command line programs in Java for a while now and am investigating ways to implement a GUI solution. I am new to this so any help would be extremely helpful. Thanks in advance.
I have recently asked another question about buttons but I now have another.

I have been learning from a book how to use the action listener to perform actions based on buttons. However, in the book, the buttons simply called a method which produced a text output.

I need a way to allow the user to press a button which takes him/her to a new window with different buttons/options and if the user wants they can press another button to return to the previous window. If someone could show me a skeleton solution with explanation for my example below:

user is presented with two buttons, “library menu” and “account menu”
if the user presses “library menu” they are taken to a window with options to add book, delete book, etc with a final button to return back to the home screen.
If the user presses “Accounts menu” they are presented with a new window/menu with buttons to add, delete, rename, etc and again a final button to return back to the home screen/main menu.

With the command line this was simple because choosing library would call a method in the library class. That method would have a switch case which called different methods based on the users input and when the user entered ‘e’ for example the switch case had an option to return out of the method i.e. a return statement took the user back to the method that initially called it (in the home screen).

I am extremely grateful for any help/advice/information on this!!!!

  • 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-15T11:05:39+00:00Added an answer on June 15, 2026 at 11:05 am

    It’s generally not recommend to present multiple windows or frames to the user, it becomes quickly confusing and annoying.

    Generally, if you want to switch the view you should use a CardLayout, which would allow you to change what’s on the users main display.

    You could also use a JTabbedPane which would allow the user to move between different views as they like

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

Sidebar

Related Questions

I've been developing Java with Netbeans and have been using the Run command on
I have been developing an user interface with Java Swing, and I have met
I have been developing in Android for approximately two months now. Yesterday, my eclipse
I have been developing line drawing apps that produce lines such as these: I
I have been developing Android application where I use this code: Date d=new Date(new
I have been developing on Android with Eclipse for a while, and I recently
I have been developing a web app using play framework for a while (using
I am new to developing applications, and I have been trying to familiarize myself
Well I have been developing an application in C++ with netbeans. Now comes the
I have been reading Developing Games In Java by David Brackeen. I have understood

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.