Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GUI Problem -- Help need Urgently

Status
Not open for further replies.

tlohan

Programmer
Sep 14, 2001
19
BE
Hi,

I have a GUI that when using Java1.2 worked perfectly. Recently we upgraded to Java1.3 and for some reason the GUI is not functioning properly.

Under Java1.2 when the GUI initialised the screen appeared as follows:

|----------------------------------------------------|
|| No Profile |-------------------------------------|
|| |-------------------------------------|
|| |-------------------------------------|

The |------------------------------| is a grey panel.

Under Java1.3 the GUI appears as:

|----------------------------------------------|
|| No Profile |
|| |
|| |


The GUI code is:

private void init() {
JPanel p = getContentPanel();
p.setLayout(new GridBagLayout());

profilePanels = createProfilePanels();

profileTree = new ProfileTree(profilePanels);
profileTree.addTreeSelectionListener(new OnProfileKeySelection());

profileList.addListSelectionListener(new OnProfileKeySelection());

JScrollPane scroll = new JScrollPane(profileTree) {
public Dimension getPreferredSize() {
Dimension d = super.getPreferredSize();
d.width = 150;
return d;
}
};

tableDlg = new TableDialog(ADCApp.findParentFrame(this));

rightPanel.setLayout(cardLayout);
rightPanel.add("Blank", new JPanel());
for(int i = 0; i < profilePanels.length; ++i) {
rightPanel.add(profilePanels.toString(), profilePanels);
}

splitPane.setLeftComponent(scroll);
splitPane.setRightComponent(rightPanel);
splitPane.setBorder(null);

p.add(splitPane, new GridBagConstraints2(0, 2, 3, 1,
100.0, 100.0, GridBagConstraints.WEST, GridBagConstraints.BOTH,
new Insets(5, 0, 0, 0), 1, 1));
}
}


On initialisation I need the grey panel to appear.
Any ideas why it is not.

Cheers.
 
As a suggestion, stick away from using GridBagLayout!

It's a real awquard one to use and the others tend to do the job well enough!

Rgds

Nick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top