×

Discussion Board

Results 1 to 4 of 4

Thread: Extending form

  1. #1
    Registered User
    Join Date
    Jul 2013
    Posts
    45

    Extending form

    Help
    Am using LCDUI. When i run my app it only brings the splash screen and after a few seconds it brings a form which is empty.
    i want the form to contain the title MainMenu and also options like exit, About,Help where a user can be redirected to a particular screen.
    Correct me where i have gone gone and also how to complete Menu class.

    My app has a main class with this code
    public class Main extends MIDlet implements CommandListener {

    SplashScreen splashScreen;
    Form Menu;
    Form mainForm;
    Command exitCommand;



    protected void startApp() throws MIDletStateChangeException{
    // TODO Auto-generated method stub

    Display.getDisplay(this).setCurrent(new SplashScreen(this));

    }

    void splashScreenDone(){

    Form Menu = new Menu(" Menu");

    StringItem si1 = new StringItem(" start", null, StringItem.BUTTON);

    StringItem si2 = new StringItem(" Help", null, StringItem.BUTTON);
    StringItem si3 = new StringItem(" About", null, StringItem.BUTTON);
    StringItem si4 = new StringItem(" Exit", null, StringItem.BUTTON);

    Menu.append(si1);
    Menu.append(si2);
    Menu.append(si3);
    Menu.append(si4);


    Display.getDisplay(this).setCurrent(new Menu(null));
    }

    the splash class
    public class SplashScreen extends Canvas implements Runnable {
    private final Main midlet;
    private Image splashImage;
    private volatile boolean dismissed=false;


    SplashScreen(Main midlet){

    this.midlet=midlet;
    setFullScreenMode(true);
    splashImage=Main.createImage("/avatar.png");
    new Thread(this).start();
    }

    the Menu class

    import javax.microedition.lcdui.Form;

    public class Menu extends Form {

    public Menu(String MainMenu) {
    super("MainMenu");
    // TODO Auto-generated constructor stub
    }

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Extending form

    juliusa, welcome to the nokia Discussion board

    1. You are making the Splash screen inside your MIDlet, which is one canvas. Nothing is happening on the screen as you haven't drawn the splashImage nor you haven't override the paint () method in which you are lets suppose rendering something.

    2. Regarding the option/commands to be shown in the app, you should follow this flow:

    Start->Splash Image -> Main Menu, here the options should be displayed to the use so that the user can select one.
    So, start one timer/thread in the Splash Canvas (as you have tried) and there you draw the main menu using either the Form or Canvas. I would prefer Canvas, if this is not the rich GUI app, as you can do lots of customization here. On the Canvas you can use drawString method to draw the menu option and on the up/down key event you can change the Font of these Strings.

    Please check and revert if you still have some confusion.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Dec 2012
    Location
    India
    Posts
    264

    Re: Extending form

    Hello juliusa

    I agree with what Raj has to say.Kindly complete your splash screen class.
    Ref : http://developer.nokia.com/Community..._Splash_Screen

    Why are you extending a form for your Menu ?Although it doesnot make any big difference,this is not necessary for your case.When you have more forms, it can get confusing.It is a lot easier and simpler to understand if you just create an instance of Form class.
    i.e.. Form menu = new Form("Menu"); instead of
    Form menu = new Menu("Menu");

  4. #4
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: Extending form

    Hello Juliusa,

    An example is available here.
    Please, take a look.

Similar Threads

  1. Extending the API?
    By grift in forum Nokia MixRadio Windows Phone API
    Replies: 1
    Last Post: 2013-04-05, 09:15
  2. Extending appuifw
    By nikhil_vaj in forum Symbian
    Replies: 0
    Last Post: 2005-07-28, 07:16
  3. extending CAknDoubleStyleListBox
    By kamosoft in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-05-24, 08:43
  4. Extending SMS
    By Nokia_Archive in forum General Messaging
    Replies: 3
    Last Post: 2002-05-28, 10:02

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •