×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Nokia Developer Champion
    Join Date
    Mar 2011
    Posts
    9

    error with LWUIT com.sun.lwuit.impl.midp.CanvasImplementation

    Hi,

    I'm starting developing with J2ME and LWUIT (v1.5), I'm using NetBeans 7.0.1 and NOKIA JAVA SDK 1.0

    But I have a errors when compiling this code:

    Code:
    import javax.microedition.midlet.*;
    
    import com.sun.lwuit.*;
    import com.sun.lwuit.events.*;
    
    public class HelloLWUIT extends MIDlet implements ActionListener {
        
    
        public void startApp() {
          Display.init(this);
    
          Form f = new Form("Hello, LWUIT!");
          f.show();
          
          Command exitCommand = new Command("Exit");
          f.addCommand(exitCommand);
    //      f.setCommandListener(this);
        }
    
        public void pauseApp() {}
    
        public void destroyApp(boolean unconditional) {}
    
        public void actionPerformed(ActionEvent ae) {
          notifyDestroyed();
        }
    }
    this is the error code:

    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:\NetBeansProjects\test002\nbproject\build-impl.xml:483: Preverification failed with error code 1.
    BUILD FAILED (total time: 3 seconds)


    please what's the problem?

    my project configuration:

    http://img1.imagilive.com/1011/Image184e.jpg

    http://img1.imagilive.com/1011/Image2548.jpg

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

    Re: error with LWUIT com.sun.lwuit.impl.midp.CanvasImplementation

    Try this code instead:

    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;
    
     
    public class HelloMidlet extends javax.microedition.midlet.MIDlet implements ActionListener {
     Button mybutton;
     Form f;
       public void startApp() {
           //init the LWUIT Display
           Display.init(this);
    
           f = new Form("Hello World");
           
           mybutton=new Button("Exit");
           
           f.setLayout(new BorderLayout());
           f.addComponent(BorderLayout.CENTER, new Label("I am a Label"));
           
           mybutton.addActionListener(this);
           f.addComponent(BorderLayout.SOUTH,mybutton);
           f.show();
       }
     
       public void pauseApp() {
       }
     
       public void destroyApp(boolean unconditional) {
       }
    
        public void actionPerformed(ActionEvent ae) {
            notifyDestroyed();
        }
    }
    There are a lot of examples in the LWUIT Guide here:
    http://download.oracle.com/javame/de...vguide/toc.htm

  3. #3
    Registered User
    Join Date
    Dec 2009
    Location
    chennai
    Posts
    137

    Re: error with LWUIT com.sun.lwuit.impl.midp.CanvasImplementation

    Quote Originally Posted by aymen.ka View Post
    No need to import src.zip and src_io.zip in the Libraries and Resources. Remove that zip files and clean and build your application.
    Bharath... :)

Similar Threads

  1. Lwuit excuting error
    By mjagadeeshbabu in forum Mobile Java General
    Replies: 0
    Last Post: 2011-04-28, 11:32
  2. LWUIT building error
    By m-lamaa in forum Mobile Java General
    Replies: 4
    Last Post: 2010-07-13, 11:45
  3. Problem with RTP impl.
    By eng.mohamed in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2010-03-26, 13:06
  4. Problem with RTP impl.
    By eng.mohamed in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2010-03-26, 12:53
  5. Documentation for com.nokia.mid.impl?
    By kmunne in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2008-05-11, 23:19

Posting Permissions

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