Class WTabPanel


public class WTabPanel extends WPanel
A panel that contains creative inventory-style tabs on the top.
Since:
3.0.0
  • Constructor Details

    • WTabPanel

      public WTabPanel()
      Constructs a new tab panel.
  • Method Details

    • add

      public void add(WTabPanel.Tab tab)
      Adds a tab to this panel.
      Parameters:
      tab - the added tab
    • add

      public void add(WWidget widget, Consumer<WTabPanel.Tab.Builder> configurator)
      Configures and adds a tab to this panel.
      Parameters:
      widget - the contained widget
      configurator - the tab configurator
    • setSize

      public void setSize(int x, int y)
      Description copied from class: WWidget
      Sets the size of this widget.

      Overriding methods may restrict one of the dimensions to be a constant value, for example super.setSize(x, 20).

      Overrides:
      setSize in class WWidget
      Parameters:
      x - the new width
      y - the new height
    • addPainters

      @Environment(CLIENT) public void addPainters()
      Description copied from class: WPanel
      Adds the default background painters to this widget and all children.

      Always called before GuiDescription.addPainters() to allow users to modify painters.

      Subclasses should call super.addPainters() to ensure that children have proper default painters.

      Overrides:
      addPainters in class WPanel