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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:06:55+00:00 2026-06-08T04:06:55+00:00

I have problem with margin. Probably its very easy to solve, but i dont

  • 0

I have problem with margin. Probably its very easy to solve, but i dont know what is the cause. I have four components, three jscrollpanels and one jpanel. Components are placed like this:

components

Problem is marked with red ellipse. How to wipe this margin out? I know, that problem is related with border (even that im creating border with same method for every component). Im using this:

setBorder(BorderFactory.createTitledBorder("Sterowanie:"));

But when i dont set a border for JPanel ( component with label “Sterowanie” ), it fill all place without margin. With border, it fill just a bordered region. The code which i use to place components:

proxys = new ItemViewer("Numery:");
add(proxys, "height 65%, width 33%");

accs = new ItemViewer("Konta:");
add(accs, "height 65%, width 33%");

panel = new JPanel();
panelLayout = new MigLayout("insets 0 0 0 0");
panel.setBorder(BorderFactory.createTitledBorder("Sterowanie:"));
add(panel, "height 65%, width 34%, wrap");

log = new Log("Log:");
add(log, "height 35%, width 100%, span");

Hm?

  • 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-08T04:06:59+00:00Added an answer on June 8, 2026 at 4:06 am

    No idea why that’s happening (my first guess was a different vertical default alignment of the ItemView vs the plain panel), but can reproduce – and workaround by making all cells growable, either in the cell or in the row contraints:

        JComponent comp = new JScrollPane(new JTable(20, 1));
        comp.setBorder(new TitledBorder("Some Item"));
        JComponent other = new JScrollPane(new JTable(10, 1));
        other.setBorder(new TitledBorder("Other items"));
        JComponent panel = new JPanel();
        panel.setBorder(new TitledBorder("Stewhatever"));
        JTextArea log = new JTextArea();
        log.setBorder(new TitledBorder("Log"));
    
        MigLayout layout = new MigLayout("wrap 3, debug"); //, "", "[fill, grow]"); 
        JComponent content = new JPanel(layout);
        String cc = "width 33%, height 65%, grow";
        content.add(comp, cc);
        content.add(other, cc);
        content.add(panel, cc);
        content.add(log, "height 35%, span, grow");
    

    Without any grow, the snippet reproduces your screenshot, with a grow in either cc or the commented row constraint, all upper components are aligned at the top.

    Not sure if this is a bug or should be expected

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

Sidebar

Related Questions

I use valaddthis on joomla 1.5.25 but i have a problem with its css.
I have this problem and I'm trying to solve it using jsfiddle but I'm
I'm probably going to ask something very simple but I'm struggling here. I have
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have problem with TableView its empty. In (.h) file: @interface TableViewController : UITableViewController{
I know this is a common problem but I can't seem to find a
I have a problem with the margin-top in a nested div -- when I
I could probably do this in PHP, but I would have to include the
I have a problem wth setting two background, here it is: rightCol { margin:
I do not know how common this problem is for other users, but for

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.