×

Discussion Board

Results 1 to 4 of 4

Thread: lwuit scrolling

  1. #1
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    84

    lwuit scrolling

    hi'
    i'm building a simple application that contain 30 checkbox but unfortunately the scrolling is failed
    here is may code



    public class HelloLWUITMidlet extends MIDlet implements ActionListener {
    Command mBackCommand;
    HttpCon http= new HttpCon();

    Form f;

    public void startApp() {
    Display.init(this);

    try {
    Resources r = Resources.open("/javaTheme.res");
    UIManager.getInstance().setThemeProps(r.getTheme("javaTheme"));
    } catch (IOException ioe) {
    System.out.println("Couldn't load theme.");
    }

    Display.init(this);

    f = new Form(" ");

    for (int i=0; i<130; i++)
    {
    cb1 = new CheckBox("Daily horoscopes");
    f.addComponent(cb1);}
    f.setScrollAnimationSpeed(400);
    f.setScrollable(true);
    f.setScrollableY(true);
    f.setScrollableX(false);

    f.show();


    }
    .....

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

    Re: lwuit scrolling

    change ur code to this

    PHP Code:

    = new Form(" ");
    f.setScrollableY(true);

    for (
    int i=0i<30i++)
    {
    f.addComponent(new CheckBox("Daily horoscopes"));
    }



    f.show(); 
    Regards,
    Saurabh

  3. #3
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: lwuit scrolling

    it's a very strange loop you got there...
    to begin with I see 130 loops instead of the aforementioned 30...
    and why would you want to reset specific parameters of the form during every single pass of that loop ?
    One time is enough, after all you are setting the Form not the Checkbox...

  4. #4
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    84

    Talking Re: lwuit scrolling

    thx all
    the solution is to insert this syntax after the declaration of form



    form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));


    thx and regards

Similar Threads

  1. problem with qt4.6 QwebView kinetic scrolling
    By mismael in forum Nokia N9
    Replies: 13
    Last Post: 2010-05-17, 08:32
  2. Replies: 0
    Last Post: 2010-04-20, 12:25
  3. LCDUI Alert on an LWUIT Form
    By slugger_2003 in forum Mobile Java General
    Replies: 0
    Last Post: 2010-04-18, 13:01
  4. How to implement kinetic scrolling?
    By svdwal in forum Symbian User Interface
    Replies: 8
    Last Post: 2010-01-28, 14:36
  5. lwuit and j2me
    By Arunesh in forum Mobile Java General
    Replies: 16
    Last Post: 2009-09-12, 15:49

Posting Permissions

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