Ciao,
prova cosi':
codice:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class ImgHTML extends MIDlet implements CommandListener{
private Display display;
private TextField userName,password;
public Form form;
private Command login,cancel;
//private Image img, imge, img2;
public ImgHTML() {
form = new Form("Sign in");
userName = new TextField("LoginID:", "", 30, TextField.ANY);
password = new TextField("Password:", "", 30, TextField.PASSWORD);
cancel = new Command("Cancel", Command.CANCEL, 2);
login = new Command("Login", Command.OK, 2);
Image img = null;
Image imge = null;
Image img2 = null;
try{
img = Image.createImage("/Fastb.png");
imge = Image.createImage("/Giochib.png");
img2 = Image.createImage("/Teletu.png");
}catch(Exception e){
System.out.println(e.getMessage());
}
form.append(new ImageItem("", img, ImageItem.LAYOUT_CENTER, "Prima"));
form.append(new ImageItem(" ", imge, ImageItem.LAYOUT_LEFT, "Seconda"));
form.append(new ImageItem("", img2, ImageItem.LAYOUT_RIGHT, "Terza"));
}
public void startApp() {
display = Display.getDisplay(this);
form.append(userName);
form.append(password);
form.addCommand(cancel);
form.addCommand(login);
form.setCommandListener(this);
display.setCurrent(form);
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {
notifyDestroyed();
}
public void commandAction(Command c, Displayable d) {}
}