Willian Irving Zumwalt Guest
|
Posted: Wed Apr 28, 2004 7:14 pm Post subject: need help w/ extending jpanel width of pane |
|
|
Hey all,
I'm having a problem with the layout management of a JPanel. The panel
is not extending the full width horizontally of the tabbedpane in
which it is placed and all the controls are all bunched up together
inside the titled border of this JPanel.
Ideally, I'd like for my titled border of the JPanel to extend
horizontally the full width of the tabbed pane, and the controls
within that titled border/jpanel to be proportionatly across.
Any help/ideas much appreciated.
---
....
// the components of 'myPane' are the problem, they are
// not layed out horizontally, but rather, bunched up in the center
// and my titled border does not stretch across the entire pane, only
// around the controls.
myPane = new MyPane();
tabbedPane.addTab("myTopPanel", myPane);
....
rightSplitPanel.add(tabbedPane, BoderLayout.NORTH);
---
public class MyPane extends JPanel implements ..., ... {
....
public void createTopPanel() {
JComponent comp = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.gridwidth = 1;
...
// lots of JTextFields, Combo's, Labels, etc... here
...
comp.setBorder(BorderFactory.createTitledBorder("blah"));
this.add(comp, BorderLayout.PAGE_START);
...
}
}
|
|