/** * Your application code goes here */ package userclasses; import generated.StateMachineBase; import com.sun.lwuit.*; import com.sun.lwuit.events.ActionEvent; import com.sun.lwuit.events.ActionListener; import com.sun.lwuit.RadioButton; import com.sun.lwuit.util.Resources; import com.sun.lwuit.ButtonGroup; /** * * @author Your name here */ public class StateMachine extends StateMachineBase implements ActionListener { Button OK; Resources resources; RadioButton Verifi=new RadioButton("Verification"); RadioButton Enroll=new RadioButton("Enrollment"); Form fo,f;ButtonGroup bg=new ButtonGroup(); StateMachineBase cl=new StateMachineBase() {}; public StateMachine(String resFile) { super(resFile); } /** * 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); fo=Display.getInstance().getCurrent(); f=cl.findWelcome(fo); Verifi=cl.findVerification(f); Enroll=cl.findEnrollment(f); bg.add(Enroll); bg.add(Verifi); OK=cl.findOK(f); //f.addCommandListener(this); //Verifi.addActionListener(listener);Enroll.addActionListener(listener); } protected void initVars() { } /** * @param c * @param event */ public void actionPerformed(ActionEvent ae) { throw new UnsupportedOperationException("Not supported yet."); } protected boolean onWelcomeEXIT() { boolean val = super.onWelcomeEXIT(); return val; } protected void onWelcome_OKAction(Component c, ActionEvent event) { } ActionListener listener=new ActionListener() { public void actionPerformed(ActionEvent ae) { System.out.print("HIIIIIIIIIIII"); super.onWelcome_VerificationAction(c, event); super.onWelcome_EnrollmentAction(c, event); // Verifi = (RadioButton) c; // initialize here Verifi.addActionListener(listener); Object source =ae.getCommand(); if (Verifi.hasFocus()) { if(source==OK.getText()) { showForm("Login",null);} } else { Dialog.show("INFORMATION", "Please select option", "OK", "Cancel"); } throw new UnsupportedOperationException("Not supported yet."); } }; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)