public interface Scrollable
JViewport
,
JScrollPane
,
JScrollBar
Modifier and Type | Method and Description |
---|---|
Dimension |
getPreferredScrollableViewportSize()
返回一个视图的视图组件的首选大小。
|
int |
getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
显示逻辑行或列的组件应该计算将完全暴露一个行或列的一个块的滚动增量,这取决于方向的值。
|
boolean |
getScrollableTracksViewportHeight()
如果一个视图中应力这一高度滚动匹配视口高度返回true。
|
boolean |
getScrollableTracksViewportWidth()
如果一个视图中应力这
Scrollable 宽度到视口的宽度匹配,返回true。
|
int |
getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
显示逻辑行或列的组件应该计算将完全暴露一个新的行或列的滚动增量,这取决于方向的值。
|
Dimension getPreferredScrollableViewportSize()
JList
组件的首选大小需要容纳所有的单细胞的大小。然而,对
preferredScrollableViewportSize
价值是
JList.getVisibleRowCount
行要求尺寸。一个组件没有任何属性会影响视口大小应该返回
getPreferredSize
这里。
JViewport
的观点是这
Scrollable
的preferredsize
JComponent.getPreferredSize()
int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
滚动的容器,如滚动窗格,将使用此方法每次用户请求一个单元滚动。
visibleRect
-视图的视口内的可见区域
orientation
- swingconstants.vertical或swingconstants.horizontal。
direction
-小于零的滚动/左,大于零的下/右。
JScrollBar.setUnitIncrement(int)
int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
滚动的容器,如滚动窗格,将使用此方法每次用户请求一块滚动。
visibleRect
-视图的视口内的可见区域
orientation
- swingconstants.vertical或swingconstants.horizontal。
direction
-小于零的滚动/左,大于零的下/右。
JScrollBar.setBlockIncrement(int)
boolean getScrollableTracksViewportWidth()
Scrollable
宽度到视口的宽度匹配,返回true。例如,一个正常的文本视图支持换行将返回这里,因为这将是不受欢迎的包线消失在视窗的右边缘。注意,返回真可滚动的祖先JScrollPane中有效地禁止水平滚动。
滚动的容器,像JViewport一样,将使用此方法每次都被验证。
boolean getScrollableTracksViewportHeight()
滚动的容器,像JViewport一样,将使用此方法每次都被验证。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.