How to use the Swing text field 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 getText()
to get the text from fldTextFrom and setText()
to place the text in the field fldTextTo.
This code is from the actionPerformed event of btnSetText.
// Get the value of the Text From field and use this to set // the value of the Text To field fldTextTo.setText(fldTextFrom.getText());
getText()
is passed directly to setText()
.
The following code uses getValue()
to get the text from the text field fldIntegerFrom and setValue()
to place the text in fldIntegerTo.
This code is from the actionPerformed event of btnSetInteger.
// Get the value of the Integer From field and use this to set // the value of the Integer To field fldIntegerTo.setValue(fldIntegerFrom.getValue());
getValue()
is passed directly to setValue()
.
The following code uses getValue() to
get the text from the text field fldDateFrom and setValue()
to place the text in fldDateTo.
This code is from the actionPerformed event of btnSetDate.
// Get the value of the Date From field and use this to set // the value of the Date To field fldDateTo.setValue(fldDateFrom.getValue());