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 8730491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:02:04+00:00 2026-06-13T09:02:04+00:00

We are going to use Swing for our next project which will be a

  • 0

We are going to use Swing for our next project which will be a lightweight desktop app.

I’ve been reading the Swing tutorials on Oracle’s website and have started to get the hang of it.

I was told that instead of switching JFrame I need to work within one JFrame and switch JPanels.

My questions to you would be the following.

Can I create the JPanel designs (or their templates) in design mode (WYSIWYG editor) and call jframe.setContentPane(nameOfJPanel) or do I do them programatically in code?

Secondly, how do I structure my code… If I dynamically add new JPanels and bind their events to an event handler.. all my logic and code will be in one HUGE class with tens of methods. I just don’t know how to proceed and nowhere can I find an example with multiple (more than 6 let’s say) panels on the internet.

  • 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-13T09:02:06+00:00Added an answer on June 13, 2026 at 9:02 am

    This is how I organize my code:

    class Panel1 extends JPanel{
       //code for panel1 and its Components
    }
    
    class Panel2 extends JPanel{
       //code for panel2 and its components
    }
    // and it follows. 
    class ApplicationFrame extends JFrame{
        /// LOGIC to switch between panels
    }
    
    class Main{
      //contains main() function
    }
    

    Any HAND-CRAFTED GUI code, is better than a COMPUTER GENERATED WYSIWYG -APP Code.

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

Sidebar

Related Questions

We are going to add a 3D chart to our project that will graph
im going to use Sociallib library in my app to interact with social networks.
I am going to use the jquery autocomplete plugin and i will to set
We are going to use Solr as our search server, but all of our
I'm going to use a small example for reference. Consider a project with: inner_definitions.o
I am going to write a smart client application. This application will be swing
I am going to use http-basic-authentication in a rails app. I watched this railscast
I have a swing application in which I want to use a JCheckbox with
I am going to use ajax for my web form app without any update
I'm going to use Codeigniter's session data for my login system, but first I

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.