com.wordpress.tipsforjava.swing
[Java] Class ToggleButtonIcon
java.lang.Object
com.wordpress.tipsforjava.swing.DualIcon
com.wordpress.tipsforjava.swing.ToggleButtonIcon
public abstract class ToggleButtonIcon
extends DualIcon
The base class for displying an additional custom icon on a JCheckBox or
JRadioButton. Subclasses should furnish the default Icon provided by the
Look and Feel using UIManager.getIcon(...).
The gap between the icons is always equal to the gap between the button's
icon and text.
Extends DualIcon.
- Authors:
- Rob Camick
- Darryl Burke
- Version:
- 1.0 03/11/09
|
Constructor Summary |
protected ToggleButtonIcon(JToggleButton button, Icon customIcon, Icon defaultIcon, int horizontalPosition, int verticalPosition)
Creates a ToggleButtonIcon with the specified horizontal
and vertical positioning.
|
ToggleButtonIcon
protected ToggleButtonIcon(JToggleButton button, Icon customIcon, Icon defaultIcon, int horizontalPosition, int verticalPosition)
- Creates a
ToggleButtonIcon with the specified horizontal
and vertical positioning.
- Parameters:
button - the buttoncustomIcon - the icondefaultIcon - the default icon for the buttonhorizontalPosition - the horizontal position of the custom icon
relative to the default icon. One of the following values:
- SwingConstants.RIGHT
- SwingConstants.LEFT
- SwingConstants.CENTER
- SwingConstants.LEADING
- SwingConstants.TRAILING
LEADING and TRAILING will be interpreted in the context of the button's
ComponentOrientation.
verticalPosition - the vertical position of the custom icon
relative to the default icon
One of the following values:
- SwingConstants.CENTER
- SwingConstants.TOP
- SwingConstants.BOTTOM
getHorizontalPosition
protected static int getHorizontalPosition(JToggleButton button)
-
getHorizontalPosition
private static int getHorizontalPosition(JToggleButton button, int horizontalPosition)
-
Groovy Documentation