Hi there,
I have a screen class that creates a screen with my editfield, and a button.
I have another class with a listener for the button.
My problem is how do I get the user input in the editfield from one class into the fieldlistener class?
Please note that I do know how to program in php, c++ and Visual basic. I have never programmed in any form of JAVA. The code that I am submitting is code that I pieced together and modified thus far to give me the look that I currently need and that actually works.
Here is my code below:
PHP Code:
class DataScreen extends MainScreen
{
int USERDATA;
public SalutationScreen()
{
super();
LabelField applicationTitle =
new LabelField("Get User Data");
setTitle(applicationTitle);
// RichTextField helloWorldTextField = new RichTextField("Get User Data");
// add(helloWorldTextField);
EditField DATA = new EditField("DATA: ", "", 4, EditField.FILTER_NUMERIC);
add(DATA);
ButtonField RunCode_Button = new ButtonField("Run Code");
FieldListener sendListener = new FieldListener();
RunCode_Button.setChangeListener(sendListener);
add(RunCode_Button);
}
static class FieldListener implements
FieldChangeListener {
public void fieldChanged(Field field,
int context) {
/*HOW DO I GET the DATA from the EDITFIELD called DATA above so that way I can manipulate it? Thanks All */
}
}