need help w/ extending jpanel width of pane

From: Willian Irving Zumwalt (wizumwalt_at_yahoo.com)
Date: 04/28/04

  • Next message: Yang Xiao: "XML Parsing with DOMParser"
    Date: 28 Apr 2004 12:14:40 -0700
    
    

    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);
          ...
       }
    }
    

  • Next message: Yang Xiao: "XML Parsing with DOMParser"

    Relevant Pages

    • jpanel wont extend horizontally in tabbedpane
      ... I'm having a problem with the layout management of a JPanel. ... is not extending the full width horizontally of the tabbedpane in ... I'd like for my titled border of the JPanel to extend ... // the components of 'myPane' are the problem, ...
      (comp.lang.java.gui)
    • Re: How many warnings is too many?
      ... >> there is no point extending JPanel. ... >> JComponent is absurd. ... in extending if you're implementing a true custom component. ...
      (comp.lang.java.programmer)
    • Re: Creating a component by putting together others
      ... pathname, and a JButton next to it to launch a Choose File Dialog. ... components inside a JPanel, ... Extending JPanel is probably the easiest way to ...
      (comp.lang.java.gui)
    • Re: Newbie question
      ... > The extending style I think is less error prone. ... > keep specifying which panel you mean over and over. ... JPanel. ... "MyEmailProgram ...
      (comp.lang.java.gui)