class checkPlay extends MainScreen{
FieldChangeListener listener;
public checkPlay() {
setTitle("Testing");
listener = new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
ButtonField playButton= (ButtonField) field;
signUp sinup=new signUp();
sinup.newMethod();
}
};
ButtonField playButton = new ButtonField("Test Button");
playButton.setChangeListener(listener);
add(playButton);
}
}
class signUp extends MainScreen{
public signUp(){
BasicEditField firstName = new BasicEditField("First Name*: ", "");
BasicEditField lastName = new BasicEditField("Last Name*: ", "");
EmailAddressEditField Email = new EmailAddressEditField("Email*: ", "");
PasswordEditField password = new PasswordEditField("Password*: ", "",100, PasswordEditField.FILTER_DEFAULT);
PasswordEditField confirmPassword = new PasswordEditField("Confirm Password*: ", "",100,
PasswordEditField.FILTER_DEFAULT);
DateField birthDay=new DateField("Birthday: ",System.currentTimeMillis(),DateField.DATE);
LabelField gender = new LabelField("Gender", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
RadioButtonGroup rbg = new RadioButtonGroup();
CheckboxField condition = new CheckboxField("I agree with the conditions", false);
ButtonField joinButton = new ButtonField("JOIN NOW",ButtonField.FIELD_LEFT);
add(firstName);
add(lastName);
add(Email);
add(password);
add(confirmPassword);
add(birthDay);
add(gender);
add(new RadioButtonField("Male",rbg,true));
add(new RadioButtonField("Female",rbg,false));
add(condition);
add(joinButton);
}
void newMethod(){
setTitle("Dhoni");
}
}
I want to call newMethod class by clicking a button.
I have put a button in checkPlay class and after clicking that button, I should call to newMethod.
But this code is not giving the output correctly. Is there any problem with the code??
Please help me