viewport

abstract fun SwingModifier.viewport(unitIncrement: Int? = null, blockIncrement: Int? = null, tracksViewportWidth: Boolean? = null, tracksViewportHeight: Boolean? = null): SwingModifier

Installs the child as the scrollable content, shown in the pane's central viewport.

The four answers state how the pane scrolls this content, each null - the default - leaving the answer to the content itself: a widget scrolls by its own rows or lines (a table, a list, a tree, a text area), a container of this library by a line of its font, and anything else by the pane's own defaults. Declaring an answer keeps every answer left undeclared.

Return

this chain with the viewport region declared on it.

Parameters

unitIncrement

the pixels one arrow-button click, one keyboard line or one wheel unit scrolls by; null scrolls by the content's own line or row, and by a single pixel where the content answers nothing

blockIncrement

the pixels one page - a click in the scroll bar's track, Page Up/Page Down - scrolls by; null scrolls by the content's own page, and by a full page of the viewport where the content answers nothing

tracksViewportWidth

whether the content takes the viewport's width in place of its preferred one, which is what content that wraps within the pane is laid out by; null - and false, which asks for the same layout - widens it to the viewport where the viewport is wider, and scrolls sideways to reach the rest where it is not

tracksViewportHeight

whether the content takes the viewport's height in place of its preferred one, which is what content that fills the pane top to bottom is laid out by; null - and false, which asks for the same layout - heightens it to the viewport where the viewport is taller, and scrolls to reach the rest where it is not

See also