×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Lwuit UI synchroniztion

    Hi all,

    I am facing a problem that when I remove the code from action listener of combox it works fine but when I add my code the first time I select the value from combobox it works fine but when I change the value for second time I get this

    java.lang.NullPointerException
    at com.sun.lwuit.Form.isSingleFocusMode(Form.java:1580)
    at com.sun.lwuit.List.setHandlesInput(List.java:572)
    at com.sun.lwuit.List.keyReleased(List.java:609)
    at com.sun.lwuit.ComboBox$2.keyReleased(ComboBox.java:218)
    at com.sun.lwuit.Form.keyReleased(Form.java:1441)
    at com.sun.lwuit.Display.handleEvent(Display.java:1125)
    at com.sun.lwuit.Display.edtLoopImpl(Display.java:583)
    at com.sun.lwuit.Display.mainEDTLoop(Display.java:541)
    at com.sun.lwuit.Display$1.run(Display.java:278)

    What I derived till now is that I am setting the values of a textfield(added to same form in which combobox is) from another thread and the updation event is fired on combobox selection so first time it works well but second time since the focus is on combobox and and at the same time textfield is also updated from another thread so two components in single form has focus and that's why it throwing an exception. The same problem is faced in Blackberry development but there is eventlock for locking the UI but I cant find any such thing in Lwuit to acheive this

    Please help me out
    Regards,
    Saurabh

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

    Re: Lwuit UI synchroniztion

    But you have to take care of that for which item you are going to listen the event either for the combox or the textfield.
    I think mistaken you are listening the event for the textfield second time and not the combox, and something is null in textfield. you have to put the ptintln()'s and see that on which line and where the exception was thrown..
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: Lwuit UI synchroniztion

    Thanks raj for your response actually I am not listening for textfield I am setting the values of textfield form another thread that runs in background while the current form is displayed and when an event fire on combobox both textfield and combobox has focus as combobox from current selection and textfield from background thread and by default form is single focused if you look at stack trace it is written over there

    at com.sun.lwuit.Form.isSingleFocusMode(Form.java:1580)
    Regards,
    Saurabh

Similar Threads

  1. QT Designer - UI widget access
    By davidmct in forum Qt
    Replies: 8
    Last Post: 2010-01-06, 13:31
  2. Maemo 6 UI and Orbit
    By svdwal in forum Nokia N9
    Replies: 0
    Last Post: 2009-10-12, 13:54
  3. Carbide.c++ UI Designer deffect when using s60 2nd edition sdk
    By nyamgasoft in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 10
    Last Post: 2008-08-21, 12:15
  4. UI construction fails
    By molst in forum Symbian
    Replies: 3
    Last Post: 2007-04-02, 11:07
  5. Carbide.c++ UI Designer vs Game API
    By arachidyl in forum Symbian User Interface
    Replies: 4
    Last Post: 2006-10-25, 10:10

Posting Permissions

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