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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:25:15+00:00 2026-05-18T22:25:15+00:00

I have some controls in columns that I would like to look like this,

  • 0

I have some controls in columns that I would like to look like this, and there is one row that is an exception:

+----+------------------+----+--------------------+
| X1 | Y1               | X5 | Y5                 |
+----+------------------+----+--------------------+
| X2 | Y2               | X6 | Y6                 |
+----+------------------+----+--------------------+
| X3 | Y3               | X7 | Y7                 |
+----+-----+------------+----+--------------------+
| Special1 |  Special 2 with long description     |
+----+-----+------------+----+--------------------+
| X4 | Y4               | X8 | Y8                 |
+----+------------------+----+--------------------+

and I was wondering how to do it with MigLayout. I am using Swing JavaBuilders with its condensed YAML syntax:

X1        Y1               X5    Y5
X2        Y2               X6    Y6
X3        Y3               X7    Y7
Special1     Special2
X4        Y4               X8    Y8

What I basically would like to do is make one row (the Special1/Special2) an exception, but I’m not sure how to do it (the above YAML fragment is not right).

  • 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-05-18T22:25:15+00:00Added an answer on May 18, 2026 at 10:25 pm

    this should do it:

    public static void main(String[] args)
    {
        JFrame frame = new JFrame("Test");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.setPreferredSize(new Dimension(400, 250));
    
        Container cp = frame.getContentPane();
        cp.setLayout(new MigLayout("fill, debug"));
    
        String wrap = "wrap,";
        String span2 = "spanx 2,";
        String span3 = "spanx 3,";
    
        cp.add(new JLabel("X1"));
        cp.add(new JLabel("Y1"), span2);
        cp.add(new JLabel("X5"));
        cp.add(new JLabel("Y5"), wrap);
        cp.add(new JLabel("X2"));
        cp.add(new JLabel("Y2"), span2);
        cp.add(new JLabel("X6"));
        cp.add(new JLabel("Y6"), wrap);
        cp.add(new JLabel("X3"));
        cp.add(new JLabel("Y3"), span2);
        cp.add(new JLabel("X7"));
        cp.add(new JLabel("Y7"), wrap);
        cp.add(new JLabel("Special 1"), span2);
        cp.add(new JLabel("Special 2 with long description"), span3 + wrap);
        cp.add(new JLabel("X4"));
        cp.add(new JLabel("Y4"), span2);
        cp.add(new JLabel("X7"));
        cp.add(new JLabel("Y8"));
    
        frame.pack();
        frame.setVisible(true);
    }
    

    enjoy.

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

Sidebar

Related Questions

I have some user controls that I'm loading in SharePoint and I would prefer
In one of our project, we would like to have a calendar control that
I have a form with some controls. (Actually, this is a sort of ongoing
I have one aspx page with some controls. Also i have one DIV which
So I have columns defined like this: <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBox Text={Binding Path=COLUMN_NAME, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}
I have table with 20 to 30 rows and 3 columns. I would like
We have built some .NET controls, and we are using them as COM controls
I am new to WPF. I have Created some user Controls with some basic
I have a page with some controls, usercontrols etc. when I change a div
I have some dynamically created inputs which are not server-side controls. I want to

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.