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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:28:05+00:00 2026-05-11T07:28:05+00:00

I have to build a rather large form with many controls. The controls are

  • 0

I have to build a rather large form with many controls. The controls are divided in basic controls/settings and extended controls/settings. The user can decide if he wants to see only the basic or both basic and extended controls.

I’ve dropped all extended controls onto their own JPanel so that I can easily switch between the two views by showing or hiding this panel.

Currently I’m using GroupLayout and what happens is that the controls on different panels are not aligned:

Label aaa:     Text field Label a:       Text field Label aaaaaa:  Text field ---------------------------- Label b:    Text field Label bbb:  Text field Label bb:   Text field 

Unfortunatly I found now way to ‘synchronize’ the layouts of the two panels (except using AbsoluteLayout and fixed control coordinates)

  • Is there any way to achive this?
  • Is my whole design flawed?

EDIT: If it is possible I would like to keep the GroupLayout manager.

  • 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. 2026-05-11T07:28:06+00:00Added an answer on May 11, 2026 at 7:28 am

    As far as I know, no Swing LayoutManager (from JRE or open source) can span several panels.

    I am currently working on such a feature (which I called ‘layouts synchronization’) for my DesignGridLayout project, but it is not something easy to implements (I have started about 2 weeks ago and I still don’t see exactly if and when I will get to something interesting, but I still have high hope for it;-))

    One option you could check would be to add all components to the same panel (with just one GroupLayout then) and hide/show them based on user’s selection. Hopefully, GroupLayout will adapt the size to the situation (after calling pack()).

    If GroupLayout behaves well, then it would just be a matter of calling pack() each time after user changes his selection to show/hide extended fields.

    Else you would have to manually set the size of your panel every time the user changes his selection.

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

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I'd forget about it and just put a spinning circle!… May 11, 2026 at 11:06 am
  • added an answer The Entity Framework will never materialize a partially-complete instance. You… May 11, 2026 at 11:06 am
  • added an answer Method 1 (using new) Allocates memory for the object on… May 11, 2026 at 11:06 am

Related Questions

I have to buil a rather complex WPF UI (a hughe Grid) in code
I have to build a GUI application on Windows Mobile, and would like it
Every time I have to build a form with a DateTime field I try
I have been asked to build a web application that will be used to
I'm going to have to build a custom control for a WinForms application. But
I have a Monthly Status database view I need to build a report based
Im looking to build a thread manager for an application. I have already started
How to build a simple recommendation system? I have seen some algorithms but it
First of all, I know how to build a Java application. But I have
I have this large C++ project that I need to build on a platform

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.