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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:20:28+00:00 2026-06-03T23:20:28+00:00

First, I’m sorry for my english, it’s not my native language. I try to

  • 0

First, I’m sorry for my english, it’s not my native language. I try to do my best

I have some problems with my display. I’ve a java.util.List of Panel with some elements already inside. I’d like to insert them into a JPanel at the creation of my JDialog.
There are two JButton in my JDialog, ‘add’ and ‘delete’, wich, respectively add a new JPanel at the bottom of the JPanels and the other which delete the last JPanel added.
My problem is that there is a large gap between two JPanel, regardless of the number of JPanel added and I don’t know why…
Two demonstrations pics :


my JDialog with 3 JPanel

my JDialog with more than 3 JPanel

My layouts are GridBagLayout and I’m using WindowBuilder with Eclipse Indigo. Here is now my code. I think the problem come from the value that I assign to anchor in the GridBagConstraints…
listChamps is the List of JPanel that I want to insert
panelListFile is the JPanel where listChamps’ elements are inserted

for (int i = 0; i < listChamps.size (); ++i) {
            GridBagConstraints gbc_pan = new GridBagConstraints ();
            gbc_pan.gridwidth = 1;
            gbc_pan.fill = GridBagConstraints.HORIZONTAL;
            gbc_pan.anchor = GridBagConstraints.NORTH;
            gbc_pan.gridx = 0;
            gbc_pan.gridy = i;
            panelListFiles.add (listChamps.get (i), gbc_pan);
 }

Thanks you.

  • 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-03T23:20:30+00:00Added an answer on June 3, 2026 at 11:20 pm

    I using two ways and in both cases should be added a JPanel nested JComponents,

    • JPanel with JComponents to the JTable

    • JPanel with JComponents to the another Container

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

Sidebar

Related Questions

First sorry for my english. I am currently trying to develop a JAVA webservice
first, sorry for my bad English. I try to rewrite url generated from Form
First, i have some difficulties to find, reference and use the control, i try
first of all sorry for my bad english. I got a working PagerAdapter with
First of all, I know how to build a Java application. But I have
first take a look on this picture from localScope app : i have 2
first of all some details: I configured security as below in web.xml view plaincopy
First off, I'm coming (back) to Java from C#, so apologies if my terminology
First, some context: I'm a Python developer who has written a medium-sized application using
First you should know I have looked into many questions and none of them

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.