Building Splash Screens for my MIDlet ????
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Frank_Putzger
Posted On:   Friday, July 19, 2002 04:48 PM

i want to build a Splash Screen, please help. My Code: package ewetmidlet; import javax.microedition.lcdui.*; import javax.microedition.midlet.MIDlet; public class EwetMidletMain extends MIDlet implements CommandListener { public Display display = null; private Command cmdAdd; private Command cmdBack; private Command cmdExit; private EwetNews en = null; private EwetDates ed = null; private EwetForum ef = null; private EwetSchedule es = null; private EwetPref ep = null; private EwetServlet servlet = null; public Alert alert = null; public List mainMenu;    More>>

i want to build a Splash Screen, please help. My Code:

			
				package ewetmidlet;
				

import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;

public class EwetMidletMain extends MIDlet implements CommandListener {

public Display display = null;
private Command cmdAdd;
private Command cmdBack;
private Command cmdExit;

private EwetNews en = null;
private EwetDates ed = null;
private EwetForum ef = null;
private EwetSchedule es = null;
private EwetPref ep = null;
private EwetServlet servlet = null;
public Alert alert = null;

public List mainMenu;
private String[] mainMenuChoices = {"News",
"Termine",
"Stundenplan",
"Forum",
"Einstellungen"};


public EwetMidletMain () {
display = Display.getDisplay (this);
}

protected void startApp () {


genNewsScr ();
genMainMenu ();
genDatesMenu ();
genForumMenu ();
genScheduleMenu ();
genPrefScr ();

display.setCurrent (mainMenu);


}

protected void pauseApp () {
}


protected void destroyApp (boolean unconditional) {


ep.savePref ();


}

private void genMainMenu () {
if (mainMenu == null) {


cmdAdd = new Command ("OK", Command.OK, 1);
cmdBack = new Command ("Zurück", Command.BACK, 2);
cmdExit = new Command ("Beenden", Command.EXIT, 3);
mainMenu = new List ("EWET-Menü", List.IMPLICIT, mainMenuChoices, null);
//mainMenu.setTicker (new Ticker ("Achtung heute 1 Termin"));
mainMenu.addCommand (cmdAdd);
mainMenu.addCommand (cmdExit);
mainMenu.setCommandListener (this);


}
}

private void genNewsScr () {
en = new EwetNews (mainMenu, display);

}

private void genDatesMenu () {
ed = new EwetDates (mainMenu, display);
}

private void genScheduleMenu () {
es = new EwetSchedule (mainMenu, display);
}

private void genForumMenu () {
ef = new EwetForum ();
ef.getForumMenu ().setCommandListener (this);
}


private void genPrefScr () {
ep = new EwetPref ();
ep.getPrefScr ().setCommandListener (this);
}

public void commandAction (Command c, Displayable d) {

if (d == mainMenu) {
if (c.getCommandType () == Command.EXIT) {
ewetMidletExit ();
}
else if ((c == List.SELECT_COMMAND) || (c == cmdAdd)) {
switch (mainMenu.getSelectedIndex ()) {
case 0:
display.setCurrent (en.getMenu ());
break;
case 1:
display.setCurrent (ed.getMenu ());
break;
case 2:
display.setCurrent (es.getMenu ());
break;
case 3:
display.setCurrent (ef.getForumMenu ());
break;
case 4:
display.setCurrent (ep.getPrefScr ());
break;
}
}
}

else if (d == ef.getForumMenu ()) {
if (c == ef.cmdBack) {
display.setCurrent (mainMenu);
}
}


else if (d == ep.getPrefScr ()) {
if (c == ep.cmdBack) {
display.setCurrent (mainMenu);
}
}
}

private void ewetMidletExit () {

destroyApp (true);
notifyDestroyed ();
}

/*public void showSplashScreen(Display d, Displayable next ){
Image logo = null;

try {
logo = Image.createImage("/ewet.png" );
}
catch( IOException e ){
}

Alert a = new Alert( null,
"Copyright 2002 by Frank Putzger",
logo, null );
a.setTimeout( Alert.FOREVER );
display.setCurrent( a, next);
}*/


}
   <<Less
About | Sitemap | Contact