Class JXTitledPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

@JavaBean public class JXTitledPanel extends JXPanel
A special type of Panel that has a Title section and a Content section.
The following properties can be set with the UIManager to change the look and feel of the JXTitledPanel:
  • JXTitledPanel.titleForeground
  • JXTitledPanel.titleBackground
  • JXTitledPanel.titleFont
  • JXTitledPanel.titlePainter
  • JXTitledPanel.captionInsets ???
  • JXTitledPanel.rightDecoration
  • JXTitledPanel.leftDecoration
Author:
Richard Bair, Nicola Ken Barozzi, Jeanette Winzenburg
See Also:
  • Field Details

  • Constructor Details

    • JXTitledPanel

      public JXTitledPanel()
      Create a new JTitledPanel with an empty string for the title.
    • JXTitledPanel

      public JXTitledPanel(String title)
      Create a new JTitledPanel with the given title as the title for the panel.
      Parameters:
      title -
    • JXTitledPanel

      public JXTitledPanel(String title, Container content)
      Create a new JTitledPanel with the given String as the title, and the given Container as the content panel.
      Parameters:
      title -
      content -
  • Method Details

    • getUI

      public TitledPanelUI getUI()
      Returns the look and feel (LaF) object that renders this component.
      Overrides:
      getUI in class JPanel
      Returns:
      the TitledPanelUI object that renders this component
    • setUI

      public void setUI(TitledPanelUI ui)
      Sets the look and feel (LaF) object that renders this component.
      Parameters:
      ui - the TitledPanelUI LaF object
      See Also:
    • getUIClassID

      public String getUIClassID()
      Returns a string that specifies the name of the LaF class that renders this component.
      Overrides:
      getUIClassID in class JPanel
      Returns:
      "TitledPanelUI"
      See Also:
    • updateUI

      public void updateUI()
      Notification from the UIManager that the LaF has changed. Replaces the current UI object with the latest version from the UIManager.
      Overrides:
      updateUI in class JPanel
      See Also:
    • getTitle

      public String getTitle()
      Gets the title for this titled panel.
      Returns:
      the currently displayed title
    • setTitle

      public void setTitle(String title)
      Sets the title for this title panel.
      Parameters:
      title - the title to display
    • getContentContainer

      public Container getContentContainer()
    • setContentContainer

      public void setContentContainer(Container contentPanel)
    • setRightDecoration

      public void setRightDecoration(JComponent decoration)
      Adds the given JComponent as a decoration on the right of the title
      Parameters:
      decoration -
    • getRightDecoration

      public JComponent getRightDecoration()
    • setLeftDecoration

      public void setLeftDecoration(JComponent decoration)
      Adds the given JComponent as a decoration on the left of the title
      Parameters:
      decoration -
    • getLeftDecoration

      public JComponent getLeftDecoration()
    • getTitleFont

      public Font getTitleFont()
    • setTitleFont

      public void setTitleFont(Font titleFont)
    • setTitlePainter

      public void setTitlePainter(Painter<Component> p)
      Set the Painter to use for painting the title section of the JXTitledPanel. This value may be null, which will cause the current look and feel to paint an appropriate look
      Parameters:
      p - The Painter to use. May be null
    • getTitlePainter

      public Painter<Component> getTitlePainter()
      Returns:
      the Painter to use for painting the background of the title section
    • getTitleForeground

      public Color getTitleForeground()
    • setTitleForeground

      public void setTitleForeground(Color titleForeground)