×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    4

    Gauge problem in s40 SDK 2.0

    I have created a single javax.​microedition.​lcdui.Form, that contain a textfield and a gauge.
    But in runtime, when focus is in the textfield, and soft keyboard appear, i touch a number in the gauge, and an illegalstateexception is throw.
    Please tell me where the problem?

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Gauge problem in s40 SDK 2.0

    Here's my code...

    Code:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    
    public class GaugeTest extends MIDlet implements CommandListener {
        private static final Command EXIT = new Command("Exit", Command.EXIT, 0);
        protected void startApp() {
            Form f = new Form("Gauge Test");
            f.append(new TextField("TextField", "", 100, TextField.ANY));
            f.append(new Gauge("Gauge", true, 10, 5));
            f.addCommand(EXIT);
            f.setCommandListener(this);
            Display.getDisplay(this).setCurrent(f);
        }
        protected void pauseApp() {
        }
        protected void destroyApp(boolean b) {
        }
        public void commandAction(Command c, Displayable d) {
            if (c == EXIT) {
                notifyDestroyed();
            }
        }
    }
    Works fine for me. Does this code work for you? How is your code different?

    If you debug your code, from where is the exception thrown?

    Graham.

  3. #3
    Registered User
    Join Date
    Dec 2012
    Posts
    4

    Re: Gauge problem in s40 SDK 2.0

    Dear grahamhughes, I have re checked my code, my code is similar to your code, except i have called com.sun.lwui.Display.init() before.
    I have tried call com.sun.lwui.Display.deinitialize() before, but it does not help.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Gauge problem in s40 SDK 2.0

    Why are you calling LWUIT methods if you're using LCDUI? They don't mix well... use one or the other.

    I suggest you:

    1. replace your code with mine.
    2. check it works.
    3. if it does, start adding extra code until my code looks exactly the same as yours.
    4. every time you add something, test it.
    5. when it stops working, you've found the problem.

  5. #5
    Registered User
    Join Date
    Dec 2012
    Posts
    4

    Re: Gauge problem in s40 SDK 2.0

    I use LWUIT for almost form, but LWUIT dont have any component look like Gauge, so i use 1 LCDUI form.
    I have check, the problem seem occur if i call com.sun.lwui.Display.init() before.

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Gauge problem in s40 SDK 2.0

    Do you have a stack trace for the exception? Can you run your app in debug and find out where it comes from?

Similar Threads

  1. Gauge continous running problem
    By devdattac in forum Mobile Java General
    Replies: 0
    Last Post: 2010-11-12, 06:11
  2. Gauge Continuous_Running Problem
    By ezwrighter in forum Mobile Java General
    Replies: 3
    Last Post: 2009-07-22, 03:58
  3. Gauge Problem
    By Tiger79 in forum Mobile Java General
    Replies: 5
    Last Post: 2009-03-05, 08:39
  4. back and gauge problem
    By ingsoft in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2008-03-18, 17:41
  5. gauge
    By arbind in forum Mobile Java General
    Replies: 2
    Last Post: 2006-05-15, 11:52

Posting Permissions

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