How to use the text button control on a form.
You can run this technique code from:
NOTE First make sure that database is running on your localhost SilverStream Server | |
See the chapter on the Form Designer in the Tools Guide |
The following code uses the getText()
and setText()
methods to change the text of button tbTextButton each time the user clicks the button.
This code is from the actionPerformed event of btnChangeText.
if (tbTextButton.getText().equals("Push Me")) // If the button text is 'Push Me', change it to 'Press Me' tbTextButton.setText("Press Me"); else // Otherwise,change it to 'Push Me' tbTextButton.setText("Push Me")
The following code shows how to use the simulateClick()
method to simulate a user-clicked event on the Text button btnTextButton.
This code is from the actionPerformed of btnSimulateClick.
// Get the text button to fire its Clicked event tbTextButton.simulateClick();