Button Class

Button Class

This Package | All Packages

Control
  |
  +--Button
public class Button
extends Control
implements IButtonControl

Encapsulates a Windows button control.

Constructors
Name Description
Button() Creates a new instance of a Button control.

Methods
Name Description
getBackColor() Retrieves the current background color of the Button.
getBrush() Retrieves the brush used to display this control.
getDialogResult() Topic under construction.
getForeColor() Retrieves the current foreground color of the Button.
hasDefaultBackColor() Retrieves a boolean value that indicates whether the current value of the background color property is the same as the default value.
hasDefaultForeColor() Retrieves a boolean value that indicates whether or not the current value of the foreground color property is the same as the default value.
notifyDefault(boolean value) Topic under construction.
performClick() Generates a click event for this button, simulating a click by a user.
setDialogResult(int value) Topic under construction.

Constructors

Button.Button

Syntax
public Button();
Description

Creates a new instance of a Button control. By default, the button has no caption.

Methods

Button.getBackColor

Syntax
public Color getBackColor();
Return Value

Returns the current background color [Color.CONTROL]

Description

Retrieves the current background color of the Button. Because the color of a button is read-only, this method always returns Color.CONTROL

Button.getBrush

Syntax
public Brush getBrush();
Return Value

Returns the default system brush.

Description

Retrieves the brush used to display this control. Because the background color of a control is read-only, this method always returns the default system brush.

Button.getDialogResult

Syntax
public int getDialogResult();
Description

Topic under construction.

Button.getForeColor

Syntax
public Color getForeColor();
Return Value

Returns the current foreground color [Color.WINDOWTEXT]

Description

Retrieves the current foreground color of the Button. Because the foreground color of a button is read-only, the value returned by getForeColor always evaluates to the Color.WINDOWTEXT constant.

Button.hasDefaultBackColor

Syntax
public boolean hasDefaultBackColor();
Return Value

Returns true.

Description

Retrieves a boolean value that indicates whether the current value of the background color property is the same as the default value. Since the background color of a button cannot be changed, this method always returns true. The default background color of a button always evaluates to the Color.CONTROL constant.

Button.hasDefaultForeColor

Syntax
public boolean hasDefaultForeColor();
Return Value

Returns true.

Description

Retrieves a boolean value that indicates whether or not the current value of the foreground color property is the same as the default value. Since the foreground color of a button is read-only, the button always has the default value of Color.WINDOWTEXT, and this method always returns true.

Button.notifyDefault

Syntax
public void notifyDefault( boolean value );
Description

Topic under construction.

Button.performClick

Syntax
public void performClick();
Description

Generates a click event for this button, simulating a click by a user.

Button.setDialogResult

Syntax
public void setDialogResult( int value );
Description

Topic under construction.