|
Java Platform 1.2 Beta 4 |
|||||||||
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 | |
protected | AbstractButton.AccessibleAbstractButton
Accessiblity support. |
protected | 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 |
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(ActionListener l)
adds an ActionListener to the button |
void | addChangeListener(ChangeListener l)
Adds a ChangeListener to the button. |
void | addItemListener(ItemListener l)
adds an ItemListener to the checkbox |
protected int | checkHorizontalKey(int key,
String exception)
Ensures that the key is a valid. |
protected int | checkVerticalKey(int key,
String exception)
Ensures that the key is a valid. |
protected ActionListener | createActionListener()
|
protected ChangeListener | createChangeListener()
Subclasses that want to handle ChangeEvents differently can override this to return another ChangeListener implementation. |
protected ItemListener | createItemListener()
|
void | doClick()
Programatically perform a "click". |
void | doClick(int pressTime)
Programatically perform a "click". |
protected void | fireActionPerformed(ActionEvent event)
|
protected void | fireItemStateChanged(ItemEvent event)
|
protected void | fireStateChanged()
|
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. |
String | getLabel()
Deprecated. - Replaced by getText() |
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. |
Object[] | getSelectedObjects()
Returns an array (length 1) containing the label or null if the button is not selected. |
String | getText()
Returns the button's text. |
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 |
protected void | init(String text,
Icon icon)
|
boolean | isBorderPainted()
Returns whether the border should be painted. |
boolean | isContentAreaFilled()
Checks whether the "content area" of the button should be filled. |
boolean | isFocusPainted()
Returns whether focus should be painted. |
boolean | isRolloverEnabled()
Checks whether rollover effects are enabled. |
boolean | isSelected()
Returns the state of the button. |
protected void | paintBorder(Graphics g)
Paint the button's border if BorderPainted property is true. |
void | removeActionListener(ActionListener l)
removes an ActionListener from the button |
void | removeChangeListener(ChangeListener l)
Removes a ChangeListener from the button. |
void | removeItemListener(ItemListener l)
removes an ItemListener from the button |
void | setActionCommand(String actionCommand)
Sets the action command for this button. |
void | setBorderPainted(boolean b)
Sets whether the border should be painted. |
void | setContentAreaFilled(boolean b)
Sets whether the button should paint the content area or leave it transparent. |
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(String label)
Deprecated. - Replaced by setText(text) |
void | setMargin(Insets m)
Sets space for margin between the button's border and the label. |
void | setMnemonic(char mnemonic)
|
void | setMnemonic(int mnemonic)
Set the keyboard mnemonic on the current model |
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(String text)
Sets the button's text. |
void | setUI(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 , countComponents , deliverEvent , doLayout , findComponentAt , findComponentAt , getComponent , getComponentAt , getComponentAt , getComponentCount , getComponents , getLayout , insets , invalidate , isAncestorOf , layout , list , list , locate , minimumSize , paintComponents , paramString , preferredSize , print , printComponents , processContainerEvent , processEvent , remove , remove , removeAll , removeContainerListener , setLayout , validate , validateTree |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
Field Detail |
public static final String MODEL_CHANGED_PROPERTY
public static final String TEXT_CHANGED_PROPERTY
public static final String MNEMONIC_CHANGED_PROPERTY
public static final String MARGIN_CHANGED_PROPERTY
public static final String VERTICAL_ALIGNMENT_CHANGED_PROPERTY
public static final String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY
public static final String VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
public static final String HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY
public static final String BORDER_PAINTED_CHANGED_PROPERTY
public static final String FOCUS_PAINTED_CHANGED_PROPERTY
public static final String ROLLOVER_ENABLED_CHANGED_PROPERTY
public static final String CONTENT_AREA_FILLED_CHANGED_PROPERTY
public static final String ICON_CHANGED_PROPERTY
public static final String PRESSED_ICON_CHANGED_PROPERTY
public static final String SELECTED_ICON_CHANGED_PROPERTY
public static final String ROLLOVER_ICON_CHANGED_PROPERTY
public static final String ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY
public static final String DISABLED_ICON_CHANGED_PROPERTY
public static final String DISABLED_SELECTED_ICON_CHANGED_PROPERTY
protected ButtonModel model
protected ChangeListener changeListener
protected ActionListener actionListener
protected ItemListener itemListener
protected transient ChangeEvent changeEvent
Constructor Detail |
public AbstractButton()
Method Detail |
public String getText()
setText(java.lang.String)
public void setText(String text)
t
- the string used to set the textgetText()
public boolean isSelected()
public void setSelected(boolean b)
public void doClick()
public void doClick(int pressTime)
public void setMargin(Insets m)
m
- the space between the border and the labelpublic Insets getMargin()
public Icon getIcon()
setIcon(com.sun.java.swing.Icon)
public void setIcon(Icon defaultIcon)
g
- the icon used as the default imagegetIcon()
,
setPressedIcon(com.sun.java.swing.Icon)
public Icon getPressedIcon()
setPressedIcon(com.sun.java.swing.Icon)
public void setPressedIcon(Icon pressedIcon)
g
- the icon used as the "pressed" imagegetPressedIcon()
public Icon getSelectedIcon()
setSelectedIcon(com.sun.java.swing.Icon)
public void setSelectedIcon(Icon selectedIcon)
g
- the icon used as the "selected" imagegetSelectedIcon()
public Icon getRolloverIcon()
setRolloverIcon(com.sun.java.swing.Icon)
public void setRolloverIcon(Icon rolloverIcon)
g
- the icon used as the "rollover" imagegetRolloverIcon()
public Icon getRolloverSelectedIcon()
setRolloverSelectedIcon(com.sun.java.swing.Icon)
public void setRolloverSelectedIcon(Icon rolloverSelectedIcon)
g
- the icon used as the "selected rollover" imagegetRolloverSelectedIcon()
public Icon getDisabledIcon()
getPressedIcon()
,
setDisabledIcon(com.sun.java.swing.Icon)
public void setDisabledIcon(Icon disabledIcon)
g
- the icon used as the disabled imagegetDisabledIcon()
public Icon getDisabledSelectedIcon()
getPressedIcon()
,
setDisabledIcon(com.sun.java.swing.Icon)
public void setDisabledSelectedIcon(Icon disabledSelectedIcon)
g
- the icon used as the disabled selection imagegetDisabledSelectedIcon()
public 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, String exception)
protected int checkVerticalKey(int key, String exception)
public void setActionCommand(String actionCommand)
public String getActionCommand()
public boolean isBorderPainted()
setBorderPainted(boolean)
public void setBorderPainted(boolean b)
b
- if true and border property is not null, the border is painted.isBorderPainted()
protected void paintBorder(Graphics g)
JComponent.paint(java.awt.Graphics)
,
JComponent.setBorder(com.sun.java.swing.border.Border)
public boolean isFocusPainted()
setFocusPainted(boolean)
public void setFocusPainted(boolean b)
b
- if true, the focus state is painted.isFocusPainted()
public boolean isContentAreaFilled()
setFocusPainted(boolean)
public void setContentAreaFilled(boolean b)
b
- if true, rollover effects should be painted.isContentAreaFilled()
,
JComponent.setOpaque(boolean)
public boolean isRolloverEnabled()
setFocusPainted(boolean)
public void setRolloverEnabled(boolean b)
b
- if true, rollover effects should be painted.isRolloverEnabled()
public int getMnemonic()
public void setMnemonic(int mnemonic)
mnemonic
- the key code which represents the mnemonicpublic void setMnemonic(char mnemonic)
public ButtonModel getModel()
setModel(com.sun.java.swing.ButtonModel)
public void setModel(ButtonModel newModel)
m
- the ModelgetModel()
public ButtonUI getUI()
setUI(com.sun.java.swing.plaf.ButtonUI)
public void setUI(ButtonUI ui)
ui
- the new ButtonUIgetUI()
public void updateUI()
public void addChangeListener(ChangeListener l)
public void removeChangeListener(ChangeListener l)
protected void fireStateChanged()
public void addActionListener(ActionListener l)
public void removeActionListener(ActionListener l)
protected ChangeListener createChangeListener()
protected void fireActionPerformed(ActionEvent event)
protected void fireItemStateChanged(ItemEvent event)
protected ActionListener createActionListener()
protected ItemListener createItemListener()
public void setEnabled(boolean b)
public String getLabel()
public void setLabel(String label)
public void addItemListener(ItemListener l)
public void removeItemListener(ItemListener l)
public Object[] getSelectedObjects()
protected void init(String text, Icon icon)
|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |