×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    simple LWUIT issue...?

    I'm facing two simple issue in lwuit

    1 --> i create a image and i want to display on the form.

    try {
    happyImage = Image.createImage("/res/happy.png");
    } catch (IOException e) {
    e.printStackTrace();
    }

    and i also try this link http://discussion.forum.nokia.com/fo...ns-using-Lwuit too.

    but i got this error
    HTML Code:
    java.io.IOException
    	at javax.microedition.lcdui.ImmutableImage.getImageFromStream(+15)
    	at javax.microedition.lcdui.ImmutableImage.<init>(+20)
    	at javax.microedition.lcdui.Image.createImage(+8)
    	at com.sun.lwuit.impl.midp.GameCanvasImplementation.createImage(+4)
    	at com.sun.lwuit.Image.createImage(+14)
    	at com.test.form.firstForm.startApp(+131)
    	at javax.microedition.midlet.MIDletProxy.startApp(+7)
    	at com.sun.midp.midlet.Scheduler.schedule(+270)
    	at com.sun.midp.main.Main.runLocalClass(+28)
    	at com.sun.midp.main.Main.main(+80)
    2--> I want to display a simple label at the bottom of the form
    Code:
    	sampleLabel = new Label("ThisIsLabel");
    		sampleLabel.setTextPosition(Component.BOTTOM);
    		sampleForm.addComponent(sampleLabel);
    but i display on the top of the form only. label doesn't change.

    i'm very very new to lwuit. please help me
    kumar

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

    Re: simple LWUIT issue...?

    1. Check the name of the image you are loading?
    2. Try to remove the res which you have prefixed before the name of the image,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Re: simple LWUIT issue...?

    name of the image is same as in the res folder. I just adding a image to the button. I got the same error.

    try {
    happyImage = Image.createImage("/happy.png");
    } catch (IOException e) {
    e.printStackTrace();
    }
    sampleButton = new Button("Button");
    sampleButton.setIcon(happyImage);
    sampleForm.addComponent(sampleButton);
    help me,
    kumar.

Similar Threads

  1. LWUIT Issue - refreshTheme gives NullPointerException
    By moltenice in forum Mobile Java General
    Replies: 2
    Last Post: 2011-02-21, 07:53
  2. Can any Resolve this issue, regarding LWUIT forms
    By rajan701v in forum Mobile Java General
    Replies: 1
    Last Post: 2010-12-20, 17:30
  3. Issue with LWUIT TableLayout..
    By lynxgeek in forum Mobile Java General
    Replies: 0
    Last Post: 2010-12-03, 07:05
  4. LWUIT Issue
    By giaviv in forum Mobile Java General
    Replies: 4
    Last Post: 2010-06-04, 16:53
  5. setSingleLineTextArea(false) problem - j2me lwuit issue
    By elaltaico in forum Mobile Java General
    Replies: 0
    Last Post: 2009-07-21, 10:24

Posting Permissions

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