×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    22

    setting the position of gauge in form in j2me

    I am using gauge for progress bar after a click on login button of the form.
    i have two fields username and password in loginform.
    after a click on login

    gauge = new Gauge("", false, Gauge.INDEFINITE, Gauge.CONTINUOUS_RUNNING);
    loginForm.append(gauge);

    here the progressbar is shown at right side after the password field.

    i want to set in the middle at the same position.

  2. #2
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,100

    Re: setting the position of gauge in form in j2me

    Hello jugal.inani!

    Indeed there are ways to align your content on the Form. If you are working more with the Forms in j2me there are certain principles that you should know to be able to get the most out of the alignment feature.

    As you already are peforming the append to the Form you use, I would suggest you to have a look at this following article, as it offers a very clear and comprehensive introduction to adding and aligning components on the Midlet Form with examples:

    http://www.developer.com/java/other/...tm#Form_layout

    When you are working with forms in j2me you will definetly face these situations in different ways later aswell. The concept is about Form having components in rows, rows breaking and alignment alltogether. So you could perhaps study the alignment by testing different possibilities on your own application.

    If the default setup is being followed then


    e.g.
    The current alignment

    The layout algorithm has a concept of a current alignment with the following values:

    * Item.LAYOUT_LEFT
    * Item.LAYOUT_CENTER
    * Item.LAYOUT_RIGHT

    If the layout direction is left-to-right, the initial alignment value is LAYOUT_LEFT. Similarly, if the layout direction is right-to-left, the initial alignment is LAYOUT_RIGHT.

    The current alignment persists as new items are added to the form. The current alignment can be changed by adding a new Item that was constructed using a layout directive that is different from the current alignment. Not all constructors for Item subclasses allow for a layout directive. However, all subclasses of Item inherit a method named setLayout, which can be used to change the current alignment.
    Especially note this : "The current alignment can be changed by adding a new Item that was constructed using a layout directive that is different from the current alignment."

    So at the moment if you are putting components side by side, one after another on one line, then you can tell the application to change that behaviour and instead put the next component e.g. middle and on the next row.

    Best Regards,
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

Similar Threads

  1. Working with Tabbed form in J2ME
    By tharindufit in forum Mobile Java General
    Replies: 2
    Last Post: 2011-12-26, 11:32
  2. Setting theme background for J2ME Applet in S60
    By drodil in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2010-01-26, 13:58
  3. problem in setting the player position
    By mobi1 in forum Symbian Media (Closed)
    Replies: 7
    Last Post: 2008-03-13, 11:32
  4. Getting form position, how?
    By pillar in forum Mobile Java General
    Replies: 2
    Last Post: 2006-04-28, 07:42
  5. How can I build Setting form in my application
    By clickzika in forum Symbian
    Replies: 1
    Last Post: 2005-02-16, 13:18

Posting Permissions

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