JViewport, JScrollPane, JScrollBar
| Modifier and Type | Method and Description |
|---|---|
| public Dimension | Returns: the preferredSize of aJViewport whose view
is this ScrollableReturns the preferred size of the viewport for a view component. |
| public int | Returns: The "block" increment for scrolling in the specified direction. This value should always be positive.The view area visible within the viewport visibleRect, int Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL. orientation, int Less than zero to scroll up/left, greater than zero for down/right. direction)Components that display logical rows or columns should compute the scroll increment that will completely expose one block of rows or columns, depending on the value of orientation. |
| public boolean | Returns: True if a viewport should force the Scrollables height to match its own.Return true if a viewport should always force the height of this Scrollable to match the height of the viewport. |
| public boolean | Returns: True if a viewport should force the Scrollables width to match its own.Return true if a viewport should always force the width of this
|
| public int | Returns: The "unit" increment for scrolling in the specified direction. This value should always be positive.The view area visible within the viewport visibleRect, int Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL. orientation, int Less than zero to scroll up/left, greater than zero for down/right. direction)Components that display logical rows or columns should compute the scroll increment that will completely expose one new row or column, depending on the value of orientation. |
| getPreferredScrollableViewportSize | back to summary |
|---|---|
| public Dimension getPreferredScrollableViewportSize() Returns the preferred size of the viewport for a view component.
For example, the preferred size of a
| |
| getScrollableBlockIncrement | back to summary |
|---|---|
| public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) Components that display logical rows or columns should compute the scroll increment that will completely expose one block of rows or columns, depending on the value of orientation. Scrolling containers, like JScrollPane, will use this method each time the user requests a block scroll.
| |
| getScrollableTracksViewportHeight | back to summary |
|---|---|
| public boolean getScrollableTracksViewportHeight() Return true if a viewport should always force the height of this Scrollable to match the height of the viewport. For example a columnar text view that flowed text in left to right columns could effectively disable vertical scrolling by returning true here. Scrolling containers, like JViewport, will use this method each time they are validated.
| |
| getScrollableTracksViewportWidth | back to summary |
|---|---|
| public boolean getScrollableTracksViewportWidth() Return true if a viewport should always force the width of this
Scrolling containers, like JViewport, will use this method each time they are validated.
| |
| getScrollableUnitIncrement | back to summary |
|---|---|
| public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) Components that display logical rows or columns should compute the scroll increment that will completely expose one new row or column, depending on the value of orientation. Ideally, components should handle a partially exposed row or column by returning the distance required to completely expose the item. Scrolling containers, like JScrollPane, will use this method each time the user requests a unit scroll.
| |