ACOP Button

AcopButton

Description

AcopButton is a displayer that sets desired value on remote connection point when pressed. User can specify desired value in actionValue property.

Code examples

The following lines show an example how to use the features of the AcopButton.

Common features

For features shared with other ACOP Beans see this page.

Set action value

The action value represents the value that is being set to remote connection point when button is pressed. If we want to see, what value is currently set, we call:

button.getActionValue();

Or if we want to change it:

button.setActionValue(3.456);

Set text on the button

To set the text on the button to something else, e.g. "Proceed", we simply call:

button.setText("Proceed");

Other properties

Other properties of the button can also simply be adjusted by calling the appropriate setter methods. These properties include background/foreground color, font etc:

button.setBackground(Color.RED);
button.setForeground(Color.GREEN);
button.setFont(button.getFont().deriveFont(24f));

Complete source code for examples

See the complete source code used in this examples.