Class GridBagLayoutPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class GridBagLayoutPanel extends JPanel
A panel designed for make the production of forms easier and faster.

It is a JPanel with a GridBagLayout that allows easily adding new components in rows that are automatically added and aligned by using the addComponent(...) methods.
Author:
jaume dominguez faus - jaume.dominguez@iver.es
See Also:
  • Field Details

    • y

      protected int y
      The number of components already added to the layout manager.
  • Constructor Details

    • GridBagLayoutPanel

      public GridBagLayoutPanel()
  • Method Details

    • addComponent

      public void addComponent(String label, Component comp)
      Adds a labeled component to the option pane. Components are added in a vertical fashion, one per row. The label is displayed to the left of the component.
      Parameters:
      label - The label
      comp - The component
    • addComponent

      public void addComponent(String label, Component comp, int fill)
      Adds a labeled component to the option pane. Components are added in a vertical fashion, one per row. The label is displayed to the left of the component.
      Parameters:
      label - The label
      comp - The component
      fill - Fill parameter to GridBagConstraints for the right component
    • addComponent

      public void addComponent(String label, Component comp, Insets insets)
    • addComponent

      public void addComponent(String label, Component comp, int fill, Insets insets)
    • addComponent

      public void addComponent(Component comp1, Component comp2)
      Adds a labeled component to the option pane. Components are added in a vertical fashion, one per row. The label is displayed to the left of the component.
      Parameters:
      comp1 - The label
      comp2 - The component
      Since:
      jEdit 4.1pre3
    • addComponent

      public void addComponent(Component comp1, Component comp2, int fill)
      Adds two components in a single line using the default inset (borders of margin)
      Parameters:
      comp1 -
      comp2 -
      fill -
    • addComponent

      public void addComponent(Component comp1, Component comp2, int fill, Insets insets)
      Adds a labeled component to the option pane. Components are added in a vertical fashion, one per row. The label is displayed to the left of the component.
      Parameters:
      comp1 - The label
      comp2 - The component
      fill - Fill parameter to GridBagConstraints for the right component
      Since:
      jEdit 4.1pre3
    • addComponent

      public void addComponent(Component comp1, Component comp2, Component comp3, int fill)
      Adds three components in a line using the default insets
      Parameters:
      comp1 -
      comp2 -
      comp3 -
      fill -
    • addComponent

      public void addComponent(Component comp1, Component comp2, Component comp3, int fill, Insets insets)
      Adds three components (azabala)
      Parameters:
      comp1 -
      comp2 -
      comp3 -
      fill -
    • addComponent

      public void addComponent(Component comp1, Component comp2, Component comp3)
      Adds three components in a single line using the default BOTH fill constraint
      Parameters:
      comp1 -
      comp2 -
      comp3 -
    • addComponent

      public void addComponent(Component comp)
    • addComponent

      public void addComponent(Component comp, Insets insets)
      Adds a component to the option pane. Components are added in a vertical fashion, one per row.
      Parameters:
      comp - The component
    • addComponent

      public void addComponent(Component comp, Insets insets, int numRows)
      (azabala) Adds a component which is going to fill many rows of the grid (useful to add scrollpanes with list, etc.)
    • addComponent

      public void addComponent(Component comp, int fill)
    • addComponent

      public void addComponent(Component comp, int fill, Insets insets)
      Adds a component to the option pane. Components are added in a vertical fashion, one per row.
      Parameters:
      comp - The component
      fill - Fill parameter to GridBagConstraints
    • newLabel

      public JLabel newLabel(String label, Component comp)
      Returns:
      a label which has the same tooltiptext as the Component that it is a label for. This is used to create labels from inside AbstractPreferencePage.
    • addBlank

      public void addBlank()
      Adds an empty row to the form. It can be used as a separator to improve panel appearance and comprehension.
    • hasChanged

      public boolean hasChanged()
    • setChanged

      public void setChanged(boolean changed)