Class TitledPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class TitledPanel extends JPanel
Adds a border to a component that displays a title and provides a area for adding components (usually icon buttons)
See Also:
  • Constructor Details

    • TitledPanel

      public TitledPanel(String name, JComponent panel, int margin)
      Creates a new TitlePanel
      Parameters:
      name - the name of the panel
      panel - the component to wrap
      margin - the size of the margin to use
    • TitledPanel

      public TitledPanel(JLabel titleLabel, JComponent panel, int margin)
      Creates a new TitlePanel
      Parameters:
      titleLabel - the title label for the panel; this allow clients to provide HTML-based title text. Note: it is up to the client to escape this text as needed for safety
      panel - the component to wrap
      margin - the size of the margin to use
  • Method Details

    • setTitleName

      public void setTitleName(String name)
    • addTitleComponent

      public void addTitleComponent(JComponent comp)
      Adds a component to the right side of the title bar.
      Parameters:
      comp - the component to add.
    • setBottomComponent

      public void setBottomComponent(JComponent comp)
      Sets a component below the main panel that was passed to the constructor. If the component passed to this method is null then the TitledPanel will not have a component below the main panel.
      Parameters:
      comp - the component to display below the main panel. Null indicates none.