- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JLayer<V>
-
- 参数类型
-
V
-JLayer
的视图组件的类型
- 实现的所有接口
-
ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
,Accessible
,Scrollable
public final class JLayer<V extends Component> extends JComponent implements Scrollable, PropertyChangeListener, Accessible
JLayer
是Swing组件的通用装饰器,使您能够实现各种高级绘画效果,并接收在其边界内生成的所有AWTEvent
的通知。JLayer
将绘制和输入事件的处理委托给LayerUI
对象,该对象执行实际装饰。LayerUI
实现的自定义LayerUI
和事件通知适用于JLayer本身及其所有子组件。 这种组合使您可以通过添加新的高级功能来丰富现有组件,例如临时锁定层次结构,复合组件的数据提示,增强的鼠标滚动等等。JLayer
是一个很好的解决方案,如果您只需要对复合组件进行自定义绘制或从其子组件捕获输入事件。import javax.swing.*; import javax.swing.plaf.LayerUI; import java.awt.*; public class JLayerSample { private static JLayer<JComponent> createLayer() { // This custom layerUI will fill the layer with translucent green // and print out all mouseMotion events generated within its borders LayerUI<JComponent> layerUI = new LayerUI<JComponent>() { public void paint(Graphics g, JComponent c) { // paint the layer as is super.paint(g, c); // fill it with the translucent green g.setColor(new Color(0, 128, 0, 128)); g.fillRect(0, 0, c.getWidth(), c.getHeight()); } public void installUI(JComponent c) { super.installUI(c); // enable mouse motion events for the layer's subcomponents ((JLayer) c).setLayerEventMask(AWTEvent.MOUSE_MOTION_EVENT_MASK); } public void uninstallUI(JComponent c) { super.uninstallUI(c); // reset the layer event mask ((JLayer) c).setLayerEventMask(0); } // overridden method which catches MouseMotion events public void eventDispatched(AWTEvent e, JLayer<? extends JComponent> l) { System.out.println("AWTEvent detected: " + e); } }; // create a component to be decorated with the layer JPanel panel = new JPanel(); panel.add(new JButton("JButton")); // create the layer for the panel using our custom layerUI return new JLayer<JComponent>(panel, layerUI); } private static void createAndShowGUI() { final JFrame frame = new JFrame(); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); // work with the layer as with any other Swing component frame.add(createLayer()); frame.setSize(200, 200); frame.setLocationRelativeTo(null); frame.setVisible(true); } public static void main(String[] args) throws Exception { SwingUtilities.invokeAndWait(new Runnable() { public void run() { createAndShowGUI(); } }); } }
注意:JLayer
不支持以下方法:-
Container.add(java.awt.Component)
-
Container.add(String, java.awt.Component)
-
Container.add(java.awt.Component, int)
-
Container.add(java.awt.Component, Object)
-
Container.add(java.awt.Component, Object, int)
UnsupportedOperationException
被抛出,添加一个组件到JLayer
使用setView(Component)
或setGlassPane(JPanel)
。- 从以下版本开始:
- 1.7
- 另请参见:
-
JLayer(Component)
,setView(Component)
,getView()
,LayerUI
,JLayer(Component, LayerUI)
,setUI(javax.swing.plaf.LayerUI)
,getUI()
, Serialized Form
-
-
嵌套类汇总
-
嵌套类/接口声明在类 javax.swing.JComponent
JComponent.AccessibleJComponent
-
嵌套类/接口声明在类 java.awt.Container
Container.AccessibleAWTContainer
-
-
字段汇总
-
声明的属性在类 javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
声明的属性在类 java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields declared in interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
方法摘要
所有方法 实例方法 具体的方法 变量和类型 方法 描述 protected void
addImpl(Component comp, Object constraints, int index)
JLayer
不支持此方法,并始终抛出UnsupportedOperationException
JPanel
createGlassPane()
由构造函数方法调用以创建默认值glassPane
。void
doLayout()
代表其功能LayerUI.doLayout(JLayer)
方法,如果LayerUI
设置。AccessibleContext
getAccessibleContext()
获取与此JLayer
关联的AccessibleContext。Border
getBorder()
如果视图组件是javax.swing.JComponent
的实例,javax.swing.JComponent
其功能委托给getView().getBorder()
方法,否则返回null
。JPanel
getGlassPane()
返回JLayer
的glassPane组件或null
。long
getLayerEventMask()
返回此JLayer
及其LayerUI
要接收的事件掩码的位图。Dimension
getPreferredScrollableViewportSize()
返回视图组件的视口的首选大小。int
getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
返回滚动增量,这是显示逻辑行或列的组件所必需的,以便完全显示一个行或列的块,具体取决于方向的值。boolean
getScrollableTracksViewportHeight()
返回false
以指示视口的高度不确定图层的高度,除非图层的首选高度小于视口的高度。boolean
getScrollableTracksViewportWidth()
返回false
以指示视口的宽度不确定图层的宽度,除非图层的首选宽度小于视口的宽度。int
getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
返回滚动增量,这是显示逻辑行或列的组件所必需的,以便完全公开一个新行或列,具体取决于方向的值。LayerUI<? super V>
getUI()
返回LayerUI
此JLayer
。V
getView()
返回JLayer
的视图组件或null
。boolean
imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
代表其功能LayerUI.imageUpdate(java.awt.Image, int, int, int, int, int, JLayer)
方法,如果LayerUI
设置。boolean
isOptimizedDrawingEnabled()
JLayer
会覆盖此方法的默认实现(在JComponent
)以返回false
。protected boolean
isPaintingOrigin()
始终返回true
以使绘画源自JLayer
或其祖先之一。void
paint(Graphics g)
委托所有绘画到LayerUI
对象。protected void
paintComponent(Graphics g)
此方法为空,因为所有绘制都是通过paint(Graphics)
和ComponentUI.update(Graphics, JComponent)
方法完成的void
paintImmediately(int x, int y, int w, int h)
代表其功能LayerUI.paintImmediately(int, int, int, int, JLayer)
方法,如果LayerUI
设置。void
setBorder(Border border)
如果视图组件是javax.swing.JComponent
的实例,javax.swing.JComponent
其功能委托给getView().setBorder(Border)
方法,否则此方法是无操作。void
setGlassPane(JPanel glassPane)
设置JLayer
的glassPane组件,可以是null
。void
setLayerEventMask(long layerEventMask)
启用JLayer 及其指定事件掩码参数定义的 所有后代的事件,以将其传递给LayerUI.eventDispatched(AWTEvent, JLayer)
方法。void
setLayout(LayoutManager mgr)
设置此容器的布局管理器。void
setUI(LayerUI<? super V> ui)
设置LayerUI
,它将执行绘制并接收此JLayer
输入事件。void
setView(V view)
设置JLayer
的视图组件,可以是null
。void
updateUI()
代表其功能LayerUI.updateUI(JLayer)
方法,如果LayerUI
设置。-
声明方法的类 javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
声明方法的类 java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
-
声明方法的类 java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
声明方法的类 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
声明方法的接口 java.beans.PropertyChangeListener
propertyChange
-
-
-
-
构造方法详细信息
-
JLayer
public JLayer()
使用null
视图组件创建新的JLayer
对象,默认为LayerUI
。
-
JLayer
public JLayer(V view)
使用默认值LayerUI
创建新的JLayer
对象。- 参数
-
view
- 此JLayer
要装饰的组件 - 另请参见:
-
setUI(javax.swing.plaf.LayerUI<? super V>)
-
JLayer
public JLayer(V view, LayerUI<V> ui)
创建一个新的JLayer
带有指定视图组件和对象LayerUI
对象。- 参数
-
view
- 要装饰的组件 -
ui
- 此4860364895569将使用JLayer
-
-
方法详细信息
-
getView
public V getView()
返回JLayer
的视图组件或null
。
这是一个绑定属性。- 结果
-
JLayer
的视图组件或null
如果不存在) - 另请参见:
-
setView(Component)
-
setView
public void setView(V view)
设置JLayer
的视图组件,可以是null
。
这是一个绑定属性。- 参数
-
view
- 此JLayer
的视图组件 - 另请参见:
-
getView()
-
setUI
public void setUI(LayerUI<? super V> ui)
设置LayerUI
,它将执行绘制并接收此JLayer
输入事件。- 参数
-
ui
-的LayerUI
这个JLayer
-
getUI
public LayerUI<? super V> getUI()
返回LayerUI
此JLayer
。- 重写:
-
getUI
在类JComponent
- 结果
-
这个
LayerUI
的JLayer
-
getGlassPane
public JPanel getGlassPane()
返回JLayer
的glassPane组件或null
。
这是一个绑定属性。- 结果
-
JLayer
的glassPane组件或null
如果不存在) - 另请参见:
-
setGlassPane(JPanel)
-
setGlassPane
public void setGlassPane(JPanel glassPane)
设置JLayer
的glassPane组件,可以是null
。
这是一个绑定属性。- 参数
-
glassPane
- 此JLayer
的glassPane组件 - 另请参见:
-
getGlassPane()
-
createGlassPane
public JPanel createGlassPane()
由构造方法调用以创建默认值glassPane
。 默认情况下,此方法创建一个新的JPanel,其可见性设置为true,不透明度设置为false。- 结果
-
默认
glassPane
-
setLayout
public void setLayout(LayoutManager mgr)
设置此容器的布局管理器。 重写此方法以防止设置布局管理器。注意:如果
mgr
不是null
,则此方法将引发异常,因为JLayer
不支持布局管理器。- 重写:
-
setLayout
在类Container
- 参数
-
mgr
- 指定的布局管理器 - 异常
-
IllegalArgumentException
- 不支持此方法 - 另请参见:
-
Container.doLayout()
,Container.getLayout()
,Container.invalidate()
-
setBorder
public void setBorder(Border border)
如果视图组件是javax.swing.JComponent
的实例,javax.swing.JComponent
其功能委托给getView().setBorder(Border)
方法,否则此方法是无操作。- 重写:
-
setBorder
类JComponent
- 参数
-
border
- 要为view
组件呈现的view
- 另请参见:
-
getView()
,JComponent.setBorder(Border)
-
getBorder
public Border getBorder()
如果视图组件是javax.swing.JComponent
的实例,javax.swing.JComponent
其功能委托给getView().getBorder()
方法,否则返回null
。- 重写:
-
getBorder
类JComponent
- 结果
-
view
组件的边框对象 - 另请参见:
-
getView()
,setBorder(javax.swing.border.Border)
,JComponent.getBorder()
-
addImpl
protected void addImpl(Component comp, Object constraints, int index)
JLayer
不支持此方法,并始终抛出UnsupportedOperationException
- 重写:
-
addImpl
类Container
- 参数
-
comp
- 要添加的组件 -
constraints
- 表示此组件的布局约束的对象 -
index
- 容器列表中插入组件的位置,其中-1
表示追加到末尾 - 异常
-
UnsupportedOperationException
- 不支持此方法 - 另请参见:
-
setView(Component)
,setGlassPane(JPanel)
-
isPaintingOrigin
protected boolean isPaintingOrigin()
始终返回true
以使绘画源自JLayer
或其祖先之一。- 重写:
-
isPaintingOrigin
类JComponent
- 结果
- 真正
- 另请参见:
-
JComponent.isPaintingOrigin()
-
paintImmediately
public void paintImmediately(int x, int y, int w, int h)
代表其功能LayerUI.paintImmediately(int, int, int, int, JLayer)
方法,如果LayerUI
设置。- 重写:
-
paintImmediately
类JComponent
- 参数
-
x
- 要绘制的区域的x值 -
y
- 要绘制的区域的y值 -
w
- 要绘制区域的宽度 -
h
- 要绘制区域的高度 - 另请参见:
-
JComponent.repaint(long, int, int, int, int)
,JComponent.isPaintingOrigin()
-
imageUpdate
public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
代表其功能LayerUI.imageUpdate(java.awt.Image, int, int, int, int, int, JLayer)
方法,如果LayerUI
设置。- Specified by:
-
imageUpdate
在界面ImageObserver
- 重写:
-
imageUpdate
,类Component
- 参数
-
img
- 正在观察的图像 -
infoflags
- 有关更多信息,请参阅imageUpdate
-
x
- x坐标 -
y
- y坐标 -
w
- 宽度 -
h
- 身高 - 结果
-
false
如果infoflags表示图像已完全加载; 否则为true
。 - 另请参见:
-
ImageObserver
,Graphics.drawImage(Image, int, int, Color, java.awt.image.ImageObserver)
,Graphics.drawImage(Image, int, int, java.awt.image.ImageObserver)
,Graphics.drawImage(Image, int, int, int, int, Color, java.awt.image.ImageObserver)
,Graphics.drawImage(Image, int, int, int, int, java.awt.image.ImageObserver)
,ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
-
paintComponent
protected void paintComponent(Graphics g)
此方法为空,因为所有绘制都是通过paint(Graphics)
和ComponentUI.update(Graphics, JComponent)
方法完成的- 重写:
-
paintComponent
在类JComponent
- 参数
-
g
- 要保护的Graphics
对象 - 另请参见:
-
JComponent.paint(java.awt.Graphics)
,ComponentUI
-
isOptimizedDrawingEnabled
public boolean isOptimizedDrawingEnabled()
JLayer
覆盖此方法的默认实现(在JComponent
)以返回false
。 这确保了绘图机械将调用JLayer
的paint
实现,而不是直接向JLayer
的孩子发送消息。- 重写:
-
isOptimizedDrawingEnabled
,类JComponent
- 结果
- 假
-
setLayerEventMask
public void setLayerEventMask(long layerEventMask)
启用JLayer 及其指定事件掩码参数定义的所有后代的事件,以将其传递给LayerUI.eventDispatched(AWTEvent, JLayer)
方法。事件被传递提供
LayerUI
设置为这个JLayer
和JLayer
是可显示的。以下示例显示如何在
LayerUI
实现中正确使用此方法:public void installUI(JComponent c) { super.installUI(c); JLayer l = (JLayer) c; // this LayerUI will receive only key and focus events l.setLayerEventMask(AWTEvent.KEY_EVENT_MASK | AWTEvent.FOCUS_EVENT_MASK); } public void uninstallUI(JComponent c) { super.uninstallUI(c); JLayer l = (JLayer) c; // JLayer must be returned to its initial state l.setLayerEventMask(0); }
默认情况下,JLayer
接收任何事件,其事件掩码为0
。- 参数
-
layerEventMask
- 要接收的事件类型的位掩码 - 另请参见:
-
getLayerEventMask()
,LayerUI.eventDispatched(AWTEvent, JLayer)
,Component.isDisplayable()
-
getLayerEventMask
public long getLayerEventMask()
返回此JLayer
及其LayerUI
要接收的事件掩码的位图。这意味着
LayerUI.eventDispatched(AWTEvent, JLayer)
方法仅接收与事件掩码匹配的事件。默认情况下,
JLayer
接收任何事件。- 结果
-
要为此
JLayer
接收的事件类型的位掩码
-
updateUI
public void updateUI()
代表其功能LayerUI.updateUI(JLayer)
方法,如果LayerUI
设置。
-
getPreferredScrollableViewportSize
public Dimension getPreferredScrollableViewportSize()
返回视图组件的视口的首选大小。如果此层的视图组件实现
Scrollable
,则此方法将其实现委托给视图组件。- Specified by:
-
getPreferredScrollableViewportSize
接口Scrollable
- 结果
- 视图组件的视口的首选大小
- 另请参见:
-
Scrollable
-
getScrollableBlockIncrement
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
返回滚动增量,这是显示逻辑行或列的组件所必需的,以便完全显示一个行或列的块,具体取决于方向的值。如果此层的视图组件实现
Scrollable
,则此方法将其实现委托给视图组件。- Specified by:
-
getScrollableBlockIncrement
,界面Scrollable
- 参数
-
visibleRect
- 视口中可见的视图区域 -
orientation
- SwingConstants.VERTICAL或SwingConstants.HORIZONTAL。 -
direction
- 向上/向左滚动小于零,向下/向右滚动大于零。 - 结果
- 滚动指定方向的“块”增量
- 另请参见:
-
Scrollable
-
getScrollableTracksViewportHeight
public boolean getScrollableTracksViewportHeight()
返回false
以指示视口的高度不确定图层的高度,除非图层的首选高度小于视口的高度。如果此层的视图组件实现
Scrollable
,则此方法将其实现委托给视图组件。- Specified by:
-
getScrollableTracksViewportHeight
,接口Scrollable
- 结果
- 图层是否应跟踪视口的高度
- 另请参见:
-
Scrollable
-
getScrollableTracksViewportWidth
public boolean getScrollableTracksViewportWidth()
返回false
以指示视口的宽度不确定图层的宽度,除非图层的首选宽度小于视口的宽度。如果此层的视图组件实现
Scrollable
,则此方法将其实现委托给视图组件。- Specified by:
-
getScrollableTracksViewportWidth
在接口Scrollable
- 结果
- 图层是否应跟踪视口的宽度
- 另请参见:
-
Scrollable
-
getScrollableUnitIncrement
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
返回滚动增量,这是显示逻辑行或列的组件所必需的,以便完全公开一个新行或列,具体取决于方向的值。 理想情况下,组件应通过返回完全暴露项目所需的距离来处理部分暴露的行或列。滚动容器(如
JScrollPane
)将在每次用户请求单元滚动时使用此方法。如果此层的视图组件实现
Scrollable
,则此方法将其实现委托给视图组件。- Specified by:
-
getScrollableUnitIncrement
在接口Scrollable
- 参数
-
visibleRect
- 视口中可见的视图区域 -
orientation
- SwingConstants.VERTICAL或SwingConstants.HORIZONTAL。 -
direction
- 向上/向左滚动小于零,向下/向右滚动大于零。 - 结果
- 在指定方向上滚动的“单位”增量。 该值应始终为正值。
- 另请参见:
-
Scrollable
-
doLayout
public void doLayout()
代表其功能LayerUI.doLayout(JLayer)
方法,如果LayerUI
设置。
-
getAccessibleContext
public AccessibleContext getAccessibleContext()
获取与此JLayer
关联的AccessibleContext。- Specified by:
-
getAccessibleContext
在界面Accessible
- 重写:
-
getAccessibleContext
类Component
- 结果
-
与此
JLayer
关联的AccessibleContext。
-
-