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 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.