vaibhav17 0 Newbie Poster

hi all ,i have problem ,i have my form welcome on which there r two radio buttons verification and enrollment,when i choose verification and click ok then next form(login) should display else when i choose enrollment and press ok then authentication form should display but its not working.I am writing my code in statemachine class and developing it on netbeans 6.9.currently i m running my desktop module.Below is my statemachine class code,i have also attach my statemachinebase class

/**

* Your application code goes here

*/

package userclasses;

import generated.StateMachineBase;

import com.sun.lwuit.*;

import com.sun.lwuit.events.*;

import com.sun.lwuit.RadioButton;

import com.sun.lwuit.Form;

import com.sun.lwuit.util.Resources;

/**

*

* @author Your name here

*/

public class StateMachine extends StateMachineBase implements ActionListener {

Resources resources;

(com.sun.lwuit.RadioButton) RadioButton Verification;//=new RadioButton("Verification") ;

RadioButton Enrollment;//=new RadioButton("Enrollment");

StateMachineBase cl=new StateMachineBase()

{};

com.sun.lwuit.ButtonGroup bg=new ButtonGroup();

Form fo,f;

public StateMachine(String resFile) {

super(resFile);

// do not modify, write code in initVars and initialize class members there,

// the constructor might be invoked too late due to race conditions that might occur

}

/**

* this method should be used to initialize variables instead of

* the constructor/class scope to avoid race conditions

*/

/*StateMachine()

{

try{

resources = Resources.open("/NEW AADHAR.res");

}

catch(java.io.IOException err)

{ err.printStackTrace(); }

cl.setHomeForm("Welcome");

fo = (Form)cl.startApp(resources,null,true);

f=cl.findWelcome(fo);

//fo.addCommandListener(this);

Verification=cl.findRadioButton1(f);

Enrollment=cl.findRadioButton(f);

f.addComponent(Verification);f.addComponent(Enrollment);

//fo.addComponent(bg,null);

bg.add(Enrollment);

bg.add(Verification);

Verification.addActionListener(this);

Enrollment.addActionListener(this);

}*/

protected void initVars() {

}

/**

*

* @param c

* @param event

*/

protected void onWelcome_OKAction(Component c, ActionEvent event) {

}

public void actionPerformed(ActionEvent ae) {

throw new UnsupportedOperationException("Not supported yet.");

}

protected boolean onWelcomeEXIT() {

// If the resource file changes the names of components this call will break notifying you that you should fix the code

boolean val = super.onWelcomeEXIT();

return val;

}

protected void onWelcome_ButtonAction(Component c, ActionEvent event) {

// If the resource file changes the names of components this call will break notifying you that you should fix the code

super.onWelcome_RadioButton1Action(c, event);

super.onWelcome_RadioButtonAction(c, event);

Verification = (com.sun.lwuit.RadioButton) c;Enrollment = (com.sun.lwuit.RadioButton) c;

if(Verification.hasFocus())

{

showForm("Login",null);

}

else if(Enrollment.hasFocus())

{

showForm("Authentication",null);

}

else

{

Dialog.show("INFORMATION","Please select option","OK","CANCEL");

}}}

thanks,

gaurav

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.