×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    4

    LWUIT compile-time error

    i am a newbie to LWUIT so probably thats why i am having this problem.This is my code


    import com.sun.lwuit.Button;
    import com.sun.lwuit.Display;
    import com.sun.lwuit.Form;
    import com.sun.lwuit.Label;
    import com.sun.lwuit.events.ActionEvent;
    import com.sun.lwuit.events.ActionListener;
    import com.sun.lwuit.layouts.BorderLayout;
    import com.sun.lwuit.plaf.UIManager;
    import com.sun.lwuit.util.Resources;
    import java.io.IOException;


    public class Ruwwa extends javax.microedition.midlet.MIDlet implements ActionListener{

    Form f;
    Button mybutton;

    public void startApp() {

    f = new Form("Mairuwa Portal");
    mybutton=new Button("Exit");

    f.setLayout(new BorderLayout());
    f.addComponent(BorderLayout.CENTER, new Label("Welcome to the Mairuwa Portal"));

    mybutton.addActionListener(this);
    f.addComponent(BorderLayout.SOUTH,mybutton);

    Display.init(this);

    try {

    Resources r = Resources.open("/working.res");
    UIManager.getInstance().setThemeProps(r.getTheme("Mairuwa Theme"));

    } catch (IOException ioe) {
    ioe.printStackTrace();
    }
    f.show();
    }

    public void pauseApp() {}

    public void destroyApp(boolean unconditional) {}

    public void actionPerformed(ActionEvent ae) {
    notifyDestroyed();
    }

    }


    I compiled this using the NOKIA SDK 1.0 emulator and added the NOKIA_IO.JAR, LWUIT_MIDP.JAR and the MIDP_IO.JAR to the resources folder.I also added my theme "working.res" to the src folder of the package.
    In my application descriptor, i have "Ruwwa" as Midlet name and "Ruwwa" as my class name

    I got the following error when did the build:

    Created dir: C:\Users\HAFIZ\Documents\NetBeansProjects\Mairuwa\build\preverifysrc
    Copying 268 files to C:\Users\HAFIZ\Documents\NetBeansProjects\Mairuwa\build\preverifysrc
    Created dir: C:\Users\HAFIZ\Documents\NetBeansProjects\Mairuwa\build\preverified
    Preverifying 268 file(s) into C:\Users\HAFIZ\Documents\NetBeansProjects\Mairuwa\build\preverified directory.
    C:\Users\HAFIZ\Documents\NetBeansProjects\Mairuwa\nbproject\build-impl.xml:483: Preverification failed with error code 1.
    BUILD FAILED (total time: 9 seconds)


    i got the following error when i did the clean and build:

    Error preverifying class com.sun.lwuit.impl.midp.CanvasImplementation
    VERIFIER ERROR com/sun/lwuit/impl/midp/GameCanvasImplementation.paintVideo(Lcom/sun/lwuit/Component;ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/ObjectV:
    Cannot find class javax/microedition/media/control/VideoControl
    C:\Users\HAFIZ\Documents\NetBeansProjects\Mairuwa\nbproject\build-impl.xml:483: Preverification failed with error code 1.
    BUILD FAILED (total time: 9 seconds)

    I also got the following error in the emulator when i ran it:

    class Not Found java/lang/classNotFoundException Ruwwa

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: LWUIT compile-time error

    The first thing you need to do is initialize the display. You need to place this line:
    Code:
    Display.init(this);
    right after this line:
    Code:
    public void startApp() {
    Only the LWUIT_MIDP.jar is needed in your case.
    Also if you are using eclipse, make sure that you right click on your project's LWUIT_MIDP.jar and select Add to Build Path. After you have added it to the build path, right click again and select Build Path>Configure Build Path>Order and Export> Select the LWUIT_MIDP.jar checkbox.
    Last edited by skalogir; 2011-11-16 at 14:26.

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    4

    Re: LWUIT compile-time error

    i use netbeans and i just replaced the line.
    i still get the Error preverifying class com.sun.lwuit.impl.midp.CanvasImplementation
    VERIFIER ERROR com/sun/lwuit/impl/midp/GameCanvasImplementation.paintVideo(Lcom/sun/lwuit/Component;ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/ObjectV:
    Cannot find class javax/microedition/media/control/VideoControl
    C:\Users\HAFIZ\Documents\NetBeansProjects\Mairuwa\nbproject\build-impl.xml:483: Preverification failed with error code 1.
    BUILD FAILED (total time: 11 seconds)

    Is there a way one can set build path in netbeans.

    My aim is to make sure the label and button show on the theme("Mairuwa Theme") which i had created with the LWUIT resource editor (mairuwa.res)

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: LWUIT compile-time error

    Hello barafyzil,

    Cannot find class javax/microedition/media/control/VideoControl
    Have you selected (check-marked from Properties -> Optional Packages) Mobile Media API from the IDE for the Nokia SDK?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

Similar Threads

  1. Compile Time Error: ambiguous access CBase
    By SymbianTH in forum Symbian
    Replies: 3
    Last Post: 2010-04-21, 10:06
  2. Compile-time error when using 'std::nothrow'
    By pacifix in forum Open C/C++
    Replies: 2
    Last Post: 2009-03-20, 07:27
  3. error in compile time
    By shailendra.jyoti in forum Mobile Java General
    Replies: 2
    Last Post: 2007-01-27, 05:41
  4. What does this compile time error mean?
    By harshdeep in forum Symbian
    Replies: 2
    Last Post: 2004-09-03, 10:24
  5. compile time ERROR
    By asangamneheri in forum Symbian
    Replies: 1
    Last Post: 2002-08-15, 12:46

Posting Permissions

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