# Class Sheet

java.lang.Object
com.codename1.ui.Component
com.codename1.ui.Container
com.codename1.ui.Sheet

All Implemented Interfaces:
  `Animation, Editable, StyleListener, Iterable<Component>`

public class Sheet extends Container

A light-weight dialog that slides up from the bottom of the screen on mobile devices. Sheets include a "title" bar, with a back/close button, a title label, and a "commands container" (`#getCommandsContainer()`) which allows you to insert your own custom components (usually buttons) in the upper right.

Custom content should be placed inside the content pane which can be retrieved via `#getContentPane()`

Usage

The general usage is to create new Sheet instance (or subclass), then call `#show()` to make it appear over the current form. If a different sheet that is currently being displayed, then calling `#show()` will replace it.

Inter-Sheet Navigation

The `java.lang.String)` constructor can take another Sheet object as a parameter, which will act as a "parent" sheet (`#getParentSheet()`. If the parent sheet is not null, then this sheet will have a "Back" button instead of a "Close" button. THe "Back" button will navigate back to the parent sheet.

When navigating between sheets, the sheet will be resized with a smooth slide animation to the preferred height of the destination sheet.

Example

    `public void start() {
    if(current != null){
    current.show();
    return;`
    Form hi = new Form("Hi World", new BorderLayout());

    Button b = new Button("Open Sheet");
    b.addActionListener(e->{
    new MySheet(null).show();

    });
    hi.add(BorderLayout.NORTH, b);
    hi.show();
    }

    private class MySheet extends Sheet {
    MySheet(Sheet parent) {
    super(parent, "My Sheet");
    Container cnt = getContentPane();
    cnt.setLayout(BoxLayout.y());
    Button gotoSheet2 = new Button("Goto Sheet 2");
    gotoSheet2.addActionListener(e->{
    new MySheet2(this).show(300);
    });
    cnt.add(gotoSheet2);
    for (String t : new String[]{"Red", "Green", "Blue", "Orange"}) {
    cnt.add(new Label(t));
    }
    }
    }

    private class MySheet2 extends Sheet {
    MySheet2(Sheet parent) {
    super(parent, "Sheet 2");
    Container cnt = getContentPane();
    cnt.setLayout(BoxLayout.y());
    cnt.setScrollableY(true);
    for (int i=0; iVideo Sample

    [Screen cast of the SheetSample demo](https://youtu.be/3okEj_JW3-k)

    View source for this sample [here](https://github.com/codenameone/CodenameOne/tree/master/Samples/samples/SheetSample).
    This sample can be run directly in the [SampleRunner](https://github.com/codenameone/CodenameOne/tree/master/Samples/).

    @author shannah

    #### Since

    7.0

- ## Field Summary

  ### Fields inherited from class Component

  `BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Sheet(Sheet parent, String title)`
  Creates a new sheet with the specified parent and title.
  `Sheet(Sheet parent, String title, String uiid)`
  Creates a new sheet with the specified parent and title.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addBackListener(ActionListener l)`
  Adds listener to be notified when user goes back to the parent.
  `void`
  `addCloseListener(ActionListener l)`
  Adds listener notified when the sheet is closed.
  `void`
  `back()`
  Goes back to the parent sheet with a default (300ms) slide animation.
  `void`
  `back(int duration)`
  Goes back to the parent sheet with a slide animation of given duration.
  `protected void`
  `deinitialize()`
  Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy.
  `static Sheet`
  `findContainingSheet(Component cmp)`
  Finds Sheet containing this component if it is currently part of a Sheet.
  `void`
  `finish(java.lang.Object result)`
  Completes the result resource returned by `#showForResult` and dismisses the sheet.
  `Container`
  `getCommandsContainer()`
  Gets the container that is rendered on the top right bar of the sheet.
  `Container`
  `getContentPane()`
  Gets the content pane of the sheet.
  `static Sheet`
  `getCurrentSheet()`
  Gets the current sheet on the current form or null if no sheet is currently being displayed.
  `Sheet`
  `getParentSheet()`
  Gets the parent sheet or null if there is none.
  `String`
  `getPosition()`
  Gets the position where the Sheet is to be displayed.
  `String`
  `getTitle()`
  Gets the title text displayed in the default title label.
  `Component`
  `getTitleComponent()`
  Gets the component currently used in the center of the title bar.
  `void`
  `hideBackButton()`
  Hides the back button.
  `protected void`
  `initComponent()`
  Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state
  `boolean`
  `isAllowClose()`
  Checks whether the user is allowed to close this sheet.
  `boolean`
  `isAncestorSheetOf(Sheet sheet)`
  Checks if the current sheet is an ancestor sheet of the given sheet.
  `static boolean`
  `isSheetVisibleAt(int x, int y)`
  `boolean`
  `isSwipeToDismissEnabled()`
  Checks whether this sheet can be dismissed by swiping it toward the edge of the screen (e.g. swiping down for a south-positioned sheet).
  `void`
  `removeBackListener(ActionListener l)`
  Removes a back listener.
  `void`
  `removeCloseListener(ActionListener l)`
  Removes a close listener.
  `void`
  `setAllowClose(boolean allowClose)`
  Sets whether the user is able to close this sheet.
  `void`
  `setHeight(int height)`
  Sets the Component height, this method is exposed for the purpose of external layout managers and should not be invoked directly.
  `void`
  `setPosition(String position)`
  Sets the position where the Sheet is to be displayed.
  `void`
  `setPosition(String phonePosition, String tabletPosition)`
  Sets the position where the Sheet is to be displayed.
  `void`
  `setSwipeToDismissEnabled(boolean swipeToDismissEnabled)`
  Enables or disables the swipe-to-dismiss gesture.
  `void`
  `setTitle(String title)`
  Sets the title text displayed in the default title label.
  `void`
  `setTitleComponent(Component cmp)`
  Sets the title component rendered in the center of the title bar.
  `void`
  `setWidth(int width)`
  Sets the Component width, this method is exposed for the purpose of external layout managers and should not be invoked directly.
  `void`
  `setX(int x)`
  Sets the Component x location relative to the parent container, this method is exposed for the purpose of external layout managers and should not be invoked directly.
  `void`
  `setY(int y)`
  Sets the Component y location relative to the parent container, this method is exposed for the purpose of external layout managers and should not be invoked directly.
  `void`
  `show()`
  Shows the sheet with the default (300ms) transition duration.
  `void`
  `show(int duration)`
  Shows the sheet over the current form using a slide-up transition with given duration in milliseconds.
  `void`
  `showBackButton()`
  Shows the back button.
  `<T> AsyncResource<T>`
  `showForResult()`
  Shows the sheet and returns an `AsyncResource` that will be completed when the sheet finishes -- either with `#finish(Object)` carrying a chosen value, or with `null` when the sheet is dismissed via back/swipe.
  `<T> AsyncResource<T>`
  `showForResult(int duration)`
  `#showForResult` with a custom slide duration.

  ### Methods inherited from class Container

  `add, add, add, add, add, add, addAll, addComponent, addComponent, addComponent, addComponent, animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, applyRTL, calcPreferredSize, cancelRepaints, clearClientProperties, constrainHeightWhenScrollable, constrainWidthWhenScrollable, contains, createAnimateHierarchy, createAnimateHierarchyFade, createAnimateLayout, createAnimateLayoutFade, createAnimateLayoutFadeAndWait, createAnimateMotion, createAnimateUnlayout, createReplaceTransition, dragInitiated, drop, encloseIn, encloseIn, findDropTargetAt, findFirstFocusable, fireClicked, flushReplace, forceRevalidate, getBottomGap, getChildrenAsList, getClosestComponentTo, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getGridPosX, getGridPosY, getLayout, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getResponderAt, getSafeAreaRoot, getScrollIncrement, getSideGap, getUIManager, initLaf, invalidate, isEnabled, isSafeArea, isSafeAreaRoot, isScrollableX, isScrollableY, isSelectableInteraction, isSurface, iterator, iterator, keyPressed, keyReleased, layoutContainer, morph, morphAndWait, paint, paintComponentBackground, paintGlass, paramString, pointerPressed, refreshTheme, removeAll, removeComponent, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, revalidateLater, revalidateWithAnimationSafety, scrollComponentToVisible, setCellRenderer, setEnabled, setLayout, setLeadComponent, setSafeArea, setSafeAreaRoot, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, setUIManager, updateTabIndices`

  ### Methods inherited from class Component

  `addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, animate, announceForAccessibility, bindProperty, blocksSideSwipe, calcScrollSize, contains, containsOrOwns, createStyleAnimation, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAccessibilityText, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getUIID, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isHScrollThumbGrabbed, isHScrollThumbHover, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollVisible, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, isVScrollThumbGrabbed, isVScrollThumbHover, keyRepeated, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, onSetFocusable, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, parsePreferredSize, pinch, pinch, pinchReleased, pointerDragged, pointerDragged, pointerHover, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAccessibilityText, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setHorizontalScrollBounds, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setPropertyValue, setPullToRefresh, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUIIDFinal, setUnselectedStyle, setVerticalScrollBounds, setVisible, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContains`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface Iterable

  `forEach`

- ## Constructor Details

  - ### Sheet

    public Sheet(Sheet parent, String title)

    Creates a new sheet with the specified parent and title.

    ###### Parameters

    - `parent`: Optional parent sheet. If non-null, then this sheet will have a "back" button instead of a "close" button. The "back" button will return to the parent sheet.

    - `title`: The title to display in the title bar of the sheet.

  - ### Sheet

    public Sheet(Sheet parent, String title, String uiid)

    Creates a new sheet with the specified parent and title.

    ###### Parameters

    - `parent`: Optional parent sheet. If non-null, then this sheet will have a "back" button instead of a "close" button. The "back" button will return to the parent sheet.

    - `title`: The title to display in the title bar of the sheet.

    - `uiid`: @param uiid Optional UIID for the sheet. If non-null, then the Sheet's uiid will be uiid, the title label's UIID will be uiid + "Title", the title bar's UIID will be uiid + "TitleBar", and the back/close button's UIID will be uiid + "BackButton".

- ## Method Details

  - ### isSheetVisibleAt

    public static boolean isSheetVisibleAt(int x, int y)

  - ### getCurrentSheet

    public static Sheet getCurrentSheet()

    Gets the current sheet on the current form or null if no sheet is currently being displayed.

    ###### Returns

    The current sheet or null.

    ###### Since

    7.0

  - ### findContainingSheet

    public static Sheet findContainingSheet(Component cmp)

    Finds Sheet containing this component if it is currently part of a Sheet.

    ###### Parameters

    - `cmp`: The component to check.

    ###### Returns

    The sheet containing the component, or null if it is not on a sheet.

    ###### Since

    7.0

  - ### isAllowClose

    public boolean isAllowClose()

    Checks whether the user is allowed to close this sheet.

    ###### Returns

    True if user can close the sheet.

  - ### setAllowClose

    public void setAllowClose(boolean allowClose)

    Sets whether the user is able to close this sheet. Default is true. If you set this value to false, then there will be no close button, and pressing outside of the sheet will have no effect.

    Child sheets will assume the settings of the parent. The back button will still work, but the top level sheet will not include a close button.

    ###### Parameters

    - `allowClose`: True to allow user to close the sheet. False to prevent it.

    ###### Since

    7.0

  - ### isSwipeToDismissEnabled

    public boolean isSwipeToDismissEnabled()

    Checks whether this sheet can be dismissed by swiping it toward the edge of the screen (e.g. swiping down for a south-positioned sheet).

    ###### Returns

    True if swipe-to-dismiss is enabled.

    ###### Since

    8.0

  - ### setSwipeToDismissEnabled

    public void setSwipeToDismissEnabled(boolean swipeToDismissEnabled)

    Enables or disables the swipe-to-dismiss gesture. When enabled (the default), a downward drag on the sheet's title bar (or the corresponding direction for other positions) will close the sheet. The gesture is also subject to `isAllowClose()`; if `allowClose` is false the gesture is disabled regardless of this flag.

    ###### Parameters

    - `swipeToDismissEnabled`: True to enable the swipe-to-dismiss gesture, false to disable it.

    ###### Since

    8.0

  - ### getContentPane

    public Container getContentPane()

    Gets the content pane of the sheet. All sheet content should be added to the content pane and not directly to the sheet.

    ###### Returns

    The content pane.

  - ### hideBackButton

    public void hideBackButton()
    Hides the back button.

  - ### showBackButton

    public void showBackButton()
    Shows the back button.

  - ### getCommandsContainer

    public Container getCommandsContainer()
    Gets the container that is rendered on the top right bar of the sheet. Use this to add buttons and other content you wish to appear in the title bar. Best not to overload this with too many things.

  - ### getTitle

    public String getTitle()

    Gets the title text displayed in the default title label.

    ###### Returns

    The sheet title text.

    ###### Since

    8.0

  - ### setTitle

    public void setTitle(String title)

    Sets the title text displayed in the default title label.

    If a custom title component is currently installed via `setTitleComponent(Component)`, this method still updates the default title label so that it will be shown if the title component is reset back to null.

    ###### Parameters

    - `title`: The title text.

    ###### Since

    8.0

  - ### getTitleComponent

    public Component getTitleComponent()

    Gets the component currently used in the center of the title bar.

    ###### Returns

    The current title component.

    ###### Since

    8.0

  - ### setTitleComponent

    public void setTitleComponent(Component cmp)

    Sets the title component rendered in the center of the title bar.

    This allows for custom title layouts such as including an image above the title text. If `null` is passed, the default title label is restored.

    ###### Parameters

    - `cmp`: The component to use for the title area, or `null` to restore the default title label.

    ###### Since

    8.0

  - ### show

    public void show()

    Shows the sheet with the default (300ms) transition duration.

    ###### See also

    - #show(int)

  - ### showForResult

    public <T> AsyncResource<T> showForResult()

    Shows the sheet and returns an `AsyncResource` that will be completed when the sheet finishes -- either with `#finish(Object)` carrying a chosen value, or with `null` when the sheet is dismissed via back/swipe.

    Lets sheets be used as inline confirmation dialogs / pickers without wiring up `addCloseListener` + state-shared variables:

        PickerSheet sheet = new PickerSheet();
        sheet.<String>showForResult().ready(new SuccessCallback<String>() {
            public void onSuccess(String picked) {
                if (picked != null) handle(picked);
            }
        });

    The result type is supplied at the call site; use `Sheet#finish(Object)` internally to complete it. The cast is unchecked at runtime -- pick a type you control inside the sheet.

    ###### Since 8.0

  - ### showForResult

    public <T> AsyncResource<T> showForResult(int duration)

    `#showForResult` with a custom slide duration.

    ###### Since 8.0

  - ### finish

    public void finish(java.lang.Object result)

    Completes the result resource returned by `#showForResult` and dismisses the sheet. No-op (besides dismissal) if `showForResult` was not used to open this sheet.

    ###### Parameters

    - `result`: the value to deliver to the resource subscriber. May be null, in which case subscribers see the same outcome as a user-initiated dismissal.

    ###### Since 8.0

  - ### show

    public void show(int duration)

    Shows the sheet over the current form using a slide-up transition with given duration in milliseconds.

    If another sheet is currently being shown, then this will replace that sheet, and use an appropriate slide animation to adjust the size.

    ###### Parameters

    - `duration`: The duration of the slide transition in milliseconds.

    ###### See also

    - #show()

  - ### getPosition

    public String getPosition()

    Gets the position where the Sheet is to be displayed. One of `BorderLayout#CENTER`, `BorderLayout#NORTH`, `BorderLayout#SOUTH`, `BorderLayout#WEST`, or `BorderLayout#EAST`. Default is `BorderLayout#SOUTH`.

    ###### See also

    - #setPosition(java.lang.String)

    - #setPosition(java.lang.String, java.lang.String)

  - ### setPosition

    public void setPosition(String position)

    Sets the position where the Sheet is to be displayed. One of `BorderLayout#CENTER`, `BorderLayout#NORTH`, `BorderLayout#SOUTH`, `BorderLayout#WEST`, or `BorderLayout#EAST`. Default is `BorderLayout#SOUTH`.

    ###### Parameters

    - `position`: One of `BorderLayout#CENTER`, `BorderLayout#NORTH`, `BorderLayout#SOUTH`, `BorderLayout#WEST`, or `BorderLayout#EAST`.

    ###### Since

    7.0

    ###### See also

    - #setPosition(java.lang.String)

    - #setPosition(java.lang.String, java.lang.String)

  - ### setPosition

    public void setPosition(String phonePosition, String tabletPosition)

    Sets the position where the Sheet is to be displayed. One of `BorderLayout#CENTER`, `BorderLayout#NORTH`, `BorderLayout#SOUTH`, `BorderLayout#WEST`, or `BorderLayout#EAST`. Default is `BorderLayout#SOUTH`.

    ###### Parameters

    - `phonePosition`: Position to use on a phone (i.e. non-tablet). One of `BorderLayout#CENTER`, `BorderLayout#NORTH`, `BorderLayout#SOUTH`, `BorderLayout#WEST`, or `BorderLayout#EAST`.

    - `tabletPosition`: Position to use on a tablet and desktop. One of `BorderLayout#CENTER`, `BorderLayout#NORTH`, `BorderLayout#SOUTH`, `BorderLayout#WEST`, or `BorderLayout#EAST`.

    ###### Since

    7.0

    ###### See also

    - #setPosition(java.lang.String)

    - #setPosition(java.lang.String, java.lang.String)

  - ### back

    public void back()

    Goes back to the parent sheet with a default (300ms) slide animation. If there is no parent sheet, then this will close the sheet.

    ###### See also

    - #back(int)

  - ### back

    public void back(int duration)

    Goes back to the parent sheet with a slide animation of given duration. If there is no parent sheet, then this will close the sheet.

    ###### Parameters

    - `duration`: Duration of the slide transition in milliseconds.

  - ### setX

    public void setX(int x)
    Description copied from class: `Component`

    Sets the Component x location relative to the parent container, this method is exposed for the purpose of external layout managers and should not be invoked directly.

    ###### Parameters

    - `x`: the current x coordinate of the components origin
    Overrides:
      `setX` in class `Component`

  - ### setY

    public void setY(int y)
    Description copied from class: `Component`

    Sets the Component y location relative to the parent container, this method is exposed for the purpose of external layout managers and should not be invoked directly.

    ###### Parameters

    - `y`: the current y coordinate of the components origin
    Overrides:
      `setY` in class `Component`

  - ### setWidth

    public void setWidth(int width)
    Description copied from class: `Component`

    Sets the Component width, this method is exposed for the purpose of external layout managers and should not be invoked directly.

    If a user wishes to affect the component size, setPreferredSize should be used.

    ###### Parameters

    - `width`: the width of the component

    ###### See also

    - #setPreferredSize
    Overrides:
      `setWidth` in class `Component`

  - ### setHeight

    public void setHeight(int height)
    Description copied from class: `Component`

    Sets the Component height, this method is exposed for the purpose of external layout managers and should not be invoked directly.

    If a user wishes to affect the component size, setPreferredSize should be used.

    ###### Parameters

    - `height`: the height of the component

    ###### See also

    - #setPreferredSize
    Overrides:
      `setHeight` in class `Component`

  - ### getParentSheet

    public Sheet getParentSheet()

    Gets the parent sheet or null if there is none.

    ###### Returns

    The parent sheet or null.

  - ### initComponent

    protected void initComponent()
    Description copied from class: `Component`
    Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state
    Overrides:
      `initComponent` in class `Component`

  - ### deinitialize

    protected void deinitialize()
    Description copied from class: `Component`
    Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy. This allows the component to deregister animators and cleanup after itself. This method is the opposite of the initComponent() method.
    Overrides:
      `deinitialize` in class `Component`

  - ### isAncestorSheetOf

    public boolean isAncestorSheetOf(Sheet sheet)

    Checks if the current sheet is an ancestor sheet of the given sheet.

    ###### Parameters

    - `sheet`: The sheet to check

    ###### Returns

    True if the current sheet is an ancestor of sheet.

    ###### Since

    7.0

  - ### addCloseListener

    public void addCloseListener(ActionListener l)

    Adds listener notified when the sheet is closed. This event is only fired when the sheet is closed without the possibility of being reopened. E.g. if a child sheet is opened (causing this sheet to be hidden), the close event won't be fired until either that child sheet is hidden (without going back), or the sheet itself is hidden, or goes back.

    ###### Parameters

    - `l`

    ###### Since

    7.0

  - ### removeCloseListener

    public void removeCloseListener(ActionListener l)

    Removes a close listener.

    ###### Parameters

    - `l`: The close listener

  - ### addBackListener

    public void addBackListener(ActionListener l)

    Adds listener to be notified when user goes back to the parent. This is not fired if the sheet is simply closed. Only if the "back" button is pressed,

    ###### Parameters

    - `l`: Listener

    ###### Since

    7.0

  - ### removeBackListener

    public void removeBackListener(ActionListener l)

    Removes a back listener.

    ###### Parameters

    - `l`: The close listener