×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    56

    Avoid form flicker?

    in my application i am handling - the itemStateChanged event .
    i have a form with a textfield , this textfield is the one whose state i am monitoring , part of that monitoring involves changing the title of the textfield - this action as i bealive causes the form to flicker.
    How do i set the form to redraw using a buffer or something ?
    also it makes another textbox on this form be invisible until i use the up key to scroll to it , how do i set that textbox to refresh graphicaly( i guess)...
    thx in advance , mike

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

    Thumbs up Re: Avoid form flicker?

    Hi,
    This is happening due to the repainting the form
    Can you put the code here,
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Avoid form flicker?

    Hi mikecotic,

    you have no control over Forms (or other high-level components, except for CustomItem) repainting operations in Java ME. Anyway, check Raj's advice and try posting relevant code here, so that others could test it, and hopefully find a workaround for it

    Just a question: which device/emulator gives you this problem?

    Pit

  4. #4
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    56

    Re: Avoid form flicker?

    my code: s60 3ed fp1 MIDp 2.0
    helloworldmidlet , in the form i got 2 textfields , one with 90000 max-len which will be handled by the itemStateChanged.


    Code:
        public void itemStateChanged(Item arg0) {
            if(arg0==this.getTextField1()){
                textField1.setLabel("there are " + textField1.getString().length()%10 + " parts.");
            }
        }
    //set the form listner
    Code:
        public Form getForm() {
            if (form == null) {
                // write pre-init user code here
                form = new Form("Welcome", new Item[] { getTextField(), getTextField1() });
                form.addCommand(getExitCommand());
                form.setCommandListener(this);
                // write post-init user code here
                form.setItemStateListener(this);
            }
            return form;
        }
    //dont forget the implementation
    Code:
    public class HelloMIDlet extends MIDlet implements CommandListener,ItemStateListener {
    code : http://www.savefile.com/files/1886400

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

    Thumbs up Re: Avoid form flicker?

    Hi,
    Another reason for the form flicker can be the thread implementation.If your thread management is not proper then also this problem can occur.Check the same..

    I have seen this before in my application...after a few hours R&d I found that this was happening due to the thread ..
    Hope this makes sense.
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  6. #6
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    56

    Re: Avoid form flicker?

    even if the case is like you said , what would i lock the ui ? by adding a scyn kw in the listner method?

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

    Thumbs up Re: Avoid form flicker?

    Hi,
    Put the code here..let me check it..complete code..

    Thread implementation must be like this that if you are working on multi threading then after finishing the work of one thread and you are coming on the other then do not forget to stop the thread..mostly in case of simple drawing...(I mean if you are not doing critical work on that thread)..since it can be run and you another thread will be running then it can cause the flickering..

    Hope this makes sense..
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. Flicker when traversing customItems in a Form??
    By hardboy111 in forum Mobile Java General
    Replies: 7
    Last Post: 2009-07-23, 08:00
  2. second form not getting key events
    By krsunil in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-12-10, 10:29
  3. Form troubles
    By matdodgson in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-12-06, 10:49
  4. Replies: 11
    Last Post: 2008-06-26, 05:54
  5. problems in creating multipage form
    By A.Vogel in forum Symbian User Interface
    Replies: 0
    Last Post: 2007-10-02, 08:16

Posting Permissions

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