Click here to Skip to main content
16,017,297 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Java
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(){
               // setTitle("Sign Up For New Account");
                 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);


             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
Posted
Updated 6-Aug-12 2:28am
v3

1 solution

 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900