GridBagLayout and tabbed pane issue

Hi,

I am running into the following issue with using GridBagLayout in my JTabbed Pane.

I have dialog with a JTabbedPane with 2 tabs:

Basic Tab

JPanel with GridBagLayout

has a JTextPane and

has a JComboBox with a JLabel

Advanced Tab

JPanel with GridBagLayout

has quite a few controls (around 6 laid out one below the other)

With only the basic tab, the dialog looks small. After adding the Advanced tab, the dialog expands to fit the controls of the advanced tab. But now the 2 controls on the basic tab are far apart. There is a lot of space then the JTextPane and more space and the JComboBox. I would like to have lesser space between the JTextPane and the JComboBox and move the controls to the beginning of the tab. Looks like the GridBagLayout on the Advanced tab is messing the Basic tab. Can anyone suggest a solution?

Thanks,

Kumar

[920 byte] By [kumar007a] at [2007-11-26 17:41:26]
# 1

> Can anyone suggest a solution?

Based on your description of the problem, no.

Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use Layout Managers[/url] and use the appropriate Layout Manager or combination of Layout Manager to achieve your desired result.

camickra at 2007-7-9 0:09:38 > top of Java-index,Desktop,Core GUI APIs...