java.lang.Object | |||
↳ | javax.swing.plaf.ComponentUI | ||
↳ | javax.swing.plaf.ScrollPaneUI | ||
↳ | javax.swing.plaf.basic.BasicScrollPaneUI |
![]() |
A default L&F implementation of ScrollPaneUI.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BasicScrollPaneUI.HSBChangeListener | Horizontal scrollbar listener. | ||||||||||
BasicScrollPaneUI.MouseWheelHandler | MouseWheelHandler is an inner class which implements the MouseWheelListener interface. | ||||||||||
BasicScrollPaneUI.PropertyChangeHandler | |||||||||||
BasicScrollPaneUI.VSBChangeListener | Vertical scrollbar listener. | ||||||||||
BasicScrollPaneUI.ViewportChangeHandler | Listener for viewport events. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
hsbChangeListener | |||||||||||
scrollpane | |||||||||||
spPropertyChangeListener | |||||||||||
viewportChangeListener | |||||||||||
vsbChangeListener |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the baseline.
| |||||||||||
Returns an enum indicating how the baseline of the component
changes as the size changes.
| |||||||||||
Returns the specified component's maximum size appropriate for
the look and feel.
| |||||||||||
Configures the specified component appropriate for the look and feel.
| |||||||||||
Paints the specified component appropriate for the look and feel.
| |||||||||||
Reverses configuration which was done on the specified component during
installUI . |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an instance of MouseWheelListener, which is added to the
JScrollPane by installUI().
| |||||||||||
Creates an instance of PropertyChangeListener that's added to
the JScrollPane by installUI().
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Returns the baseline.
c | JComponent baseline is being requested for |
---|---|
width | the width to get the baseline for |
height | the height to get the baseline for |
Returns an enum indicating how the baseline of the component changes as the size changes.
c | JComponent to return baseline resize behavior for |
---|
NullPointerException |
---|
Returns the specified component's maximum size appropriate for
the look and feel. If null
is returned, the maximum
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method invokes getPreferredSize
and returns that value.
c | the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components |
---|
Configures the specified component appropriate for the look and feel.
This method is invoked when the ComponentUI
instance is being installed
as the UI delegate on the specified component. This method should
completely configure the component for the look and feel,
including the following:
LayoutManager
on the component if necessary.
PropertyChangeListener
on the component in order
to detect and respond to component property changes appropriately.
x | the component where this UI delegate is being installed |
---|
Paints the specified component appropriate for the look and feel.
This method is invoked from the ComponentUI.update
method when
the specified component is being painted. Subclasses should override
this method and use the specified Graphics
object to
render the content of the component.
g | the Graphics context in which to paint |
---|---|
c | the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components |
Reverses configuration which was done on the specified component during
installUI
. This method is invoked when this
UIComponent
instance is being removed as the UI delegate
for the specified component. This method should undo the
configuration performed in installUI
, being careful to
leave the JComponent
instance in a clean state (no
extraneous listeners, look-and-feel-specific property objects, etc.).
This should include the following:
c | the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components |
---|
Creates an instance of MouseWheelListener, which is added to the JScrollPane by installUI(). The returned MouseWheelListener is used to handle mouse wheel-driven scrolling.
Creates an instance of PropertyChangeListener that's added to the JScrollPane by installUI(). Subclasses can override this method to return a custom PropertyChangeListener, e.g.
class MyScrollPaneUI extends BasicScrollPaneUI { protected PropertyChangeListener createPropertyChangeListener() { return new MyPropertyChangeListener(); } public class MyPropertyChangeListener extends PropertyChangeListener { public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("viewport")) { // do some extra work when the viewport changes } super.propertyChange(e); } } }