Class JRibbonFrame

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class JRibbonFrame extends JFrame

Ribbon frame. Provides the same functionality as a regular JFrame, but with a JRibbon component in the top location.

This is the only officially supported way to use the JRibbon container. While JRibbon() constructor is public, it is provided only for the applications that are absolutely prevented from using JRibbonFrame class.

The implementation enforces that a JRibbon component is always at the BorderLayout.NORTH location, throwing IllegalArgumentException on attempts to set a custom layout manager, add another component at BorderLayout.NORTH, remove the JRibbon component, set a custom menu bar, content pane or any other operation that inteferes with the intended hierarchy of this frame.

See Also:
  • Field Details

  • Constructor Details

    • JRibbonFrame

      public JRibbonFrame() throws HeadlessException
      Creates a new ribbon frame with no title.
      Throws:
      HeadlessException - If GraphicsEnvironment.isHeadless() returns true.
    • JRibbonFrame

      public JRibbonFrame(GraphicsConfiguration gc)
      Creates a new ribbon frame with no title.
      Parameters:
      gc - Graphics configuration to use.
    • JRibbonFrame

      public JRibbonFrame(String title) throws HeadlessException
      Creates a new ribbon frame with the specified title.
      Parameters:
      title - Ribbon frame title.
      Throws:
      HeadlessException - If GraphicsEnvironment.isHeadless() returns true.
    • JRibbonFrame

      public JRibbonFrame(String title, GraphicsConfiguration gc)
      Creates a new ribbon frame with the specified title.
      Parameters:
      title - Ribbon frame title.
      gc - Graphics configuration to use.
      Throws:
      HeadlessException - If GraphicsEnvironment.isHeadless() returns true.
  • Method Details

    • dispose

      public void dispose()
      Overrides:
      dispose in class Window
    • setLayout

      public void setLayout(LayoutManager manager)
      Overrides:
      setLayout in class JFrame
    • setJMenuBar

      public void setJMenuBar(JMenuBar menubar)
      Overrides:
      setJMenuBar in class JFrame
    • setContentPane

      public void setContentPane(Container contentPane)
      Specified by:
      setContentPane in interface RootPaneContainer
      Overrides:
      setContentPane in class JFrame
    • getRibbon

      public JRibbon getRibbon()
      Returns the ribbon component.
      Returns:
      Ribbon component.
    • createRootPane

      protected JRootPane createRootPane()
      Overrides:
      createRootPane in class JFrame
    • setIconImages

      public void setIconImages(List<? extends Image> icons)
      Overrides:
      setIconImages in class Window
    • setApplicationIcon

      public void setApplicationIcon(ResizableIcon icon)
    • getApplicationIcon

      public ResizableIcon getApplicationIcon()
    • isShowingKeyTips

      public boolean isShowingKeyTips()
      Returns indication whether this ribbon frame is showing the key tips.
      Returns:
      true if this ribbon frame is showing the key tips, false otherwise.