import com.app.gui.Midlet;
import javax.microedition.lcdui.Form;
public abstract class CustomForm extends Form{
protected CustomForm prevForm;
protected CustomForm thisForm;
public CustomForm() {
super("App Name");
thisForm = this;
}
abstract protected void initComponents();
abstract protected void addComponents();
public boolean setAsDisplay (CustomForm prevForm) {
thisForm.prevForm = prevForm;
return setAsDisplay();
}
public boolean setAsDisplay () {
Midlet.getDisplay().setCurrent(this);
return true;
}
protected String fillIfNull (String str) {
return fillIfNull(str, " - ");
}
String fillIfNull (String str, String nullString) {
if (str == null || str.equals("null")) {
str = nullString;
}
return str;
}
}
import javax.microedition.lcdui.Form;
public abstract class CustomForm extends Form{
protected CustomForm prevForm;
protected CustomForm thisForm;
public CustomForm() {
super("App Name");
thisForm = this;
}
abstract protected void initComponents();
abstract protected void addComponents();
public boolean setAsDisplay (CustomForm prevForm) {
thisForm.prevForm = prevForm;
return setAsDisplay();
}
public boolean setAsDisplay () {
Midlet.getDisplay().setCurrent(this);
return true;
}
protected String fillIfNull (String str) {
return fillIfNull(str, " - ");
}
String fillIfNull (String str, String nullString) {
if (str == null || str.equals("null")) {
str = nullString;
}
return str;
}
}
No comments:
Post a Comment