Je pourrais utiliser un peu d'aide. J'ai eu ce programme pour fonctionner alors j'ai découvert que je devais utiliser le design MVC. Cela semble assez simple mais, mon petit programme de jouet ne montrera pas mes formes. AIDEZ-MOI!! Voir les ci-dessous snipets:Le formulaire ne s'affichera pas. . . Dooh!
PARTIE DE MIDLet
public MileageMidlet()
{
// First get a blank user form
form = new Form("Bradford Gas Mileage Calculator");
startPage = new StartPageView();
inputScreen = new InputScreen();
calculateMileage = new CalculateMileage();
startCmd = new Command ("Start",Command.SCREEN,5);
clearCmd = new Command ("Clear",Command.SCREEN,1);
enterCmd = new Command ("Enter",Command.SCREEN,1);
exitCmd = new Command("Exit", Command.EXIT, 1);
// Set up event handlers to process user commands
form.setCommandListener(this);
}
public void startApp() {
startPage.createView(form);
form.addCommand(startCmd);
form.addCommand(exitCmd);
// Display initial form
Display.getDisplay(this).setCurrent(form);
}
PAGE D'ACCUEIL VOIR LA CLASSE
import javax.microedition.lcdui.*;
public class StartPageView
{
StringItem strgItm, strgItm2;
private Command startCmd, exitCmd;
public StartPageView()
{
}
public void createView(Form form)
{
// First get a blank user form
form.deleteAll();
form = new Form("Bradford Gas Mileage Calculator");
strgItm = new StringItem ("","Welcome to the Bradford Mobile Gas Mileage Calculator!");
strgItm2 = new StringItem ("","To obtain you gas mileage please click the start button.");
form.append(strgItm);
form.append(strgItm2);
}
Je n'ai rien! Vraiment littéralement un écran bleu.
}
Réservoirs mon! C'est ce qu'il a fait. – Mike