Java Reference
In-Depth Information
L ISTING 5.4 Continued
/**
* scrambles a string
*/
public String scramble(String s) {
return s;
}
/**
* un-scramble a string
*/
public String unscramble(String s) {
return s;
}
/**
* Registering a copy
*/
public void register(){
returnDisplayable = Display.getDisplay(midlet).getCurrent();
if (returnDisplayable==null)
returnDisplayable = new Form(“Hello”);
if (isLicensed()) {
Form f = new Form(“Software Already Licensed”);
f.append(“Impossible to register an already registered copy.”);
f.append(“Please contact support for help”);
Display.getDisplay(midlet).setCurrent(f);
f.setCommandListener(this);
f.addCommand(new Command(“back”,Command.BACK,1));
return;
}
idTextField = new TextField(“Insert Licensed User”, “”, 12,
TextField.ANY);
pwdTextField = new TextField(“Insert License Code”, “”, 15,
TextField.PASSWORD);
form = new Form(“Registration”);
form.append(idTextField);
form.append(pwdTextField);
form.addCommand(new Command(“ok”,Command.OK,1));
form.setCommandListener(this);
Display.getDisplay(midlet).setCurrent(form);
}
Search WWH ::




Custom Search