Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.AbstractButton
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner Class Summary | |
AbstractButton.AccessibleAbstractButton
Accessiblity support. |
|
AbstractButton.ButtonChangeListener
Extend ChangeListener to be serializable Warning: serialized objects of this class will not be compatible with future swing releases. |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Field Summary | |
java.awt.event.ActionListener | actionListener
|
static java.lang.String | BORDER_PAINTED_CHANGED_PROPERTY
|
ChangeEvent | changeEvent
Only one ChangeEvent is needed per button instance since the event's only state is the source property. |
ChangeListener | changeListener
The button's model listeners. |
static java.lang.String | DISABLED_ICON_CHANGED_PROPERTY
|
static java.lang.String | DISABLED_SELECTED_ICON_CHANGED_PROPERTY
|
static java.lang.String | FOCUS_PAINTED_CHANGED_PROPERTY
|
static java.lang.String | HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY
|
static java.lang.String | HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY
|
static java.lang.String | ICON_CHANGED_PROPERTY
|
java.awt.event.ItemListener | itemListener
|
static java.lang.String | MARGIN_CHANGED_PROPERTY
|
static java.lang.String | MNEMONIC_CHANGED_PROPERTY
|
static java.lang.String | MODEL_CHANGED_PROPERTY
|
ButtonModel | model
|
static java.lang.String | PRESSED_ICON_CHANGED_PROPERTY
|
static java.lang.String | ROLLOVER_ENABLED_CHANGED_PROPERTY
|
static java.lang.String | ROLLOVER_ICON_CHANGED_PROPERTY
|
static java.lang.String | ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY
|
static java.lang.String | SELECTED_ICON_CHANGED_PROPERTY
|
static java.lang.String | TEXT_CHANGED_PROPERTY
|
static java.lang.String | VERTICAL_ALIGNMENT_CHANGED_PROPERTY
|
static java.lang.String | VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
|
Fields inherited from class com.sun.java.swing.JComponent | |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
AbstractButton()
|
Method Summary | |
void | addActionListener(java.awt.event.ActionListener l)
adds an ActionListener to the button |
void | addChangeListener(ChangeListener l)
Adds a ChangeListener to the button. |
void | addItemListener(java.awt.event.ItemListener l)
adds an ItemListener to the checkbox |
int | checkHorizontalKey(int key,
java.lang.String exception)
Ensures that the key is a valid. |
int | checkVerticalKey(int key,
java.lang.String exception)
Ensures that the key is a valid. |
java.awt.event.ActionListener | createActionListener()
|
ChangeListener | createChangeListener()
Subclasses that want to handle ChangeEvents differently can override this to return another ChangeListener implementation. |
java.awt.event.ItemListener | createItemListener()
|
void | doClick()
Programatically perform a "click". |
void | doClick(int pressTime)
Programatically perform a "click". |
void | fireActionPerformed(java.awt.event.ActionEvent event)
|
void | fireItemStateChanged(java.awt.event.ItemEvent event)
|
void | fireStateChanged()
|
java.lang.String | getActionCommand()
Returns the action command for this button. |
Icon | getDisabledIcon()
Returns the icon used by the button when it's disabled. |
Icon | getDisabledSelectedIcon()
Returns the icon used by the button when it's disabled and selected. |
int | getHorizontalAlignment()
Returns the horizontal alignment of the icon and text. |
int | getHorizontalTextPosition()
Sets the horizontal position of the text relative to the icon. |
Icon | getIcon()
Returns the default icon. |
java.lang.String | getLabel()
Deprecated. |
java.awt.Insets | getMargin()
Returns the margin between the button's border and the label. |
int | getMnemonic()
Get the keyboard mnemonic from the the current model |
ButtonModel | getModel()
Get the model that this button represents. |
Icon | getPressedIcon()
Returns the pressed icon for the button. |
Icon | getRolloverIcon()
Returns the rollover icon for the button. |
Icon | getRolloverSelectedIcon()
Returns the rollover seletion icon for the button. |
Icon | getSelectedIcon()
Returns the selected icon for the button. |
java.lang.Object[] | getSelectedObjects()
|
java.lang.String | getText()
Returns the button's text. |
com.sun.java.swing.plaf.ButtonUI | getUI()
Returns the button's current UI. |
int | getVerticalAlignment()
Returns the vertical alignment of the text and icon. |
int | getVerticalTextPosition()
Returns the vertical position of the text relative to the icon Valid keys: CENTER (the default), TOP, BOTTOM |
void | init(java.lang.String text,
Icon icon)
|
boolean | isBorderPainted()
Returns whether the border should be painted. |
boolean | isFocusPainted()
Returns whether focus should be painted. |
boolean | isRolloverEnabled()
Checks whether rollover effects are enabled. |
boolean | isSelected()
Returns the state of the button. |
void | paintBorder(java.awt.Graphics g)
Paint the button's border if BorderPainted property is true. |
void | removeActionListener(java.awt.event.ActionListener l)
removes an ActionListener from the button |
void | removeChangeListener(ChangeListener l)
Removes a ChangeListener from the button. |
void | removeItemListener(java.awt.event.ItemListener l)
removes an ItemListener from the button |
void | setActionCommand(java.lang.String actionCommand)
Sets the action command for this button. |
void | setBorderPainted(boolean b)
Sets whether the border should be painted. |
void | setDisabledIcon(Icon disabledIcon)
Sets the disabled icon for the button. |
void | setDisabledSelectedIcon(Icon disabledSelectedIcon)
Sets the disabled selection icon for the button. |
void | setEnabled(boolean b)
Enables (or disables) the button. |
void | setFocusPainted(boolean b)
Sets whether focus should be painted. |
void | setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the icon and text. |
void | setHorizontalTextPosition(int textPosition)
Sets the horizontal position of the text relative to the icon. |
void | setIcon(Icon defaultIcon)
Sets the button's default icon. |
void | setLabel(java.lang.String label)
Deprecated. |
void | setMargin(java.awt.Insets m)
Sets space for margin between the button's border and the label. |
void | setMnemonic(int mnemonic)
Set the keyboard mnemonic on the current model |
void | setMnemonic(char mnemonic)
|
void | setModel(ButtonModel newModel)
Set the model that this button represents. |
void | setPressedIcon(Icon pressedIcon)
Sets the pressed icon for the button. |
void | setRolloverEnabled(boolean b)
Sets whether rollover effects should be enabled. |
void | setRolloverIcon(Icon rolloverIcon)
Sets the rollover icon for the button. |
void | setRolloverSelectedIcon(Icon rolloverSelectedIcon)
Sets the rollover selected icon for the button. |
void | setSelected(boolean b)
Sets the state of the button. |
void | setSelectedIcon(Icon selectedIcon)
Sets the selected icon for the button. |
void | setText(java.lang.String text)
Sets the button's text. |
void | setUI(com.sun.java.swing.plaf.ButtonUI ui)
Sets the button's UI. |
void | setVerticalAlignment(int alignment)
Sets the vertical alignment of the icon and text. |
void | setVerticalTextPosition(int textPosition)
Sets the vertical position of the text relative to the icon. |
void | updateUI()
Gets a new UI object from the default UIFactory. |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String MODEL_CHANGED_PROPERTY
public static final java.lang.String TEXT_CHANGED_PROPERTY
public static final java.lang.String MNEMONIC_CHANGED_PROPERTY
public static final java.lang.String MARGIN_CHANGED_PROPERTY
public static final java.lang.String VERTICAL_ALIGNMENT_CHANGED_PROPERTY
public static final java.lang.String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY
public static final java.lang.String VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
public static final java.lang.String HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY
public static final java.lang.String BORDER_PAINTED_CHANGED_PROPERTY
public static final java.lang.String FOCUS_PAINTED_CHANGED_PROPERTY
public static final java.lang.String ROLLOVER_ENABLED_CHANGED_PROPERTY
public static final java.lang.String ICON_CHANGED_PROPERTY
public static final java.lang.String PRESSED_ICON_CHANGED_PROPERTY
public static final java.lang.String SELECTED_ICON_CHANGED_PROPERTY
public static final java.lang.String ROLLOVER_ICON_CHANGED_PROPERTY
public static final java.lang.String ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY
public static final java.lang.String DISABLED_ICON_CHANGED_PROPERTY
public static final java.lang.String DISABLED_SELECTED_ICON_CHANGED_PROPERTY
protected ButtonModel model
protected ChangeListener changeListener
protected java.awt.event.ActionListener actionListener
protected java.awt.event.ItemListener itemListener
protected transient ChangeEvent changeEvent
Constructor Detail |
public AbstractButton()
Method Detail |
public java.lang.String getText()
public void setText(java.lang.String text)
t
- the string used to set the textpublic boolean isSelected()
public void setSelected(boolean b)
public void doClick()
public void doClick(int pressTime)
public void setMargin(java.awt.Insets m)
m
- the space between the border and the labelpublic java.awt.Insets getMargin()
public Icon getIcon()
public void setIcon(Icon defaultIcon)
g
- the icon used as the default imagepublic Icon getPressedIcon()
public void setPressedIcon(Icon pressedIcon)
g
- the icon used as the "pressed" imagepublic Icon getSelectedIcon()
public void setSelectedIcon(Icon selectedIcon)
g
- the icon used as the "selected" imagepublic Icon getRolloverIcon()
public void setRolloverIcon(Icon rolloverIcon)
g
- the icon used as the "rollover" imagepublic Icon getRolloverSelectedIcon()
public void setRolloverSelectedIcon(Icon rolloverSelectedIcon)
g
- the icon used as the "selected rollover" imagepublic Icon getDisabledIcon()
public void setDisabledIcon(Icon disabledIcon)
g
- the icon used as the disabled imagepublic Icon getDisabledSelectedIcon()
public void setDisabledSelectedIcon(Icon disabledSelectedIcon)
g
- the icon used as the disabled selection imagepublic int getVerticalAlignment()
public void setVerticalAlignment(int alignment)
public int getHorizontalAlignment()
public void setHorizontalAlignment(int alignment)
public int getVerticalTextPosition()
public void setVerticalTextPosition(int textPosition)
public int getHorizontalTextPosition()
public void setHorizontalTextPosition(int textPosition)
protected int checkHorizontalKey(int key, java.lang.String exception)
protected int checkVerticalKey(int key, java.lang.String exception)
public void setActionCommand(java.lang.String actionCommand)
public java.lang.String getActionCommand()
public boolean isBorderPainted()
public void setBorderPainted(boolean b)
b
- if true and border property is not null, the border is painted.protected void paintBorder(java.awt.Graphics g)
public boolean isFocusPainted()
public void setFocusPainted(boolean b)
b
- if true, the focus state is painted.public boolean isRolloverEnabled()
public void setRolloverEnabled(boolean b)
b
- if true, rollover effects should be painted.public int getMnemonic()
public void setMnemonic(int mnemonic)
mnemonic
- the key code which represents the mnemonicpublic void setMnemonic(char mnemonic)
public ButtonModel getModel()
public void setModel(ButtonModel newModel)
m
- the Modelpublic com.sun.java.swing.plaf.ButtonUI getUI()
public void setUI(com.sun.java.swing.plaf.ButtonUI ui)
ui
- the new ButtonUIpublic void updateUI()
public void addChangeListener(ChangeListener l)
public void removeChangeListener(ChangeListener l)
protected void fireStateChanged()
public void addActionListener(java.awt.event.ActionListener l)
public void removeActionListener(java.awt.event.ActionListener l)
protected ChangeListener createChangeListener()
protected void fireActionPerformed(java.awt.event.ActionEvent event)
protected void fireItemStateChanged(java.awt.event.ItemEvent event)
protected java.awt.event.ActionListener createActionListener()
protected java.awt.event.ItemListener createItemListener()
public void setEnabled(boolean b)
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
public void addItemListener(java.awt.event.ItemListener l)
public void removeItemListener(java.awt.event.ItemListener l)
public java.lang.Object[] getSelectedObjects()
protected void init(java.lang.String text, Icon icon)
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |