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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:47:39+00:00 2026-06-09T22:47:39+00:00

There are three different kinds of panel each spanning different number of grids. 1*3

  • 0

There are three different kinds of panel each spanning different number of grids. 1*3 , 1*1 , 3*1 .

add(panel1, "span 1 3,push, grow");
add(panel2, "push, grow");
add(panel3, "span 3 1,push, grow");

I want to change first panel’s constraint to “span 1 2” when it overlaps with other panel on the screen. But to find out whether it overlaps with another panel I have to know it’s bounds.

I did not set any size constraints.

Is there any way , to know ‘the bounds before the panel/component is actually displayed’?

And also, how to know the length of the rows and columns set by the MigLayout manager?

Actually I want to cover the full screen with these differently sized panels.

EDIT :

I forgot to enter the main culprit …add(lastPanel, span, push, grow)

I am trying to cover the full screen with differently sized panels. This code works for even number of rectangles but not for odd. When they are odd in number, then the last grid is always left empty . So I spanned the last panel to cover the full empty available space, but then it overlapped with the 3*1 panel.

  • 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-09T22:47:41+00:00Added an answer on June 9, 2026 at 10:47 pm

    I got this similar problem again but this time I got the answer, I might be helpful for someone, so I am posting it here.

    addAncestorListener(new AncestorListener() {
            @Override
            public void ancestorAdded(AncestorEvent event) {
                    height = getHeight();
                    width = getWidth();
                    //Modifications to the components here.
            }
    

    I wanted the dimensions set by the LayoutManager at compile time (which was not possibe). The AncestorListener did the trick, as soon as the components were laid out on the screen . It captures the dimensions and modified the components accordingly.

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

Sidebar

Related Questions

http://www.dofactory.com/Patterns/PatternFlyweight.aspx There is a UML diagram on that page. It has three different kinds
I need two kinds login if they refer to different controllers, example: site.com/consumers site.com/panel
I've PHP application that sends pushes to different kinds of smartphones. Recently BlackBerry push
There are probably different kinds of code generation. In RoR for example, Rails can
In contrast to other programming languages, C++ supports three different kinds of parameter passing:
I use two different kinds of JS libraries, but apparently, there is an error
I need to construct three examples of different kinds of attacks against the CIA
As you may know there are two different kinds of regular expressions implementations: one
Are these actually three different concepts or am I getting jumbled? (I've been reading
are there different sensitivities/settings to whitespace in ruby? i have a RoR project, where

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.