×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    5

    alignment of image in button

    Hi,
    I have added image in a button in my j2me project using lwuit.My problem is that the image appeared at the corner of the button and it is not center aligned .kindly tell me how to align the image in center.

  2. #2
    Registered User
    Join Date
    Feb 2007
    Location
    India
    Posts
    1,128

    Re: alignment of image in button

    Hi,

    you will need to set component alignment...like as:

    Image image = Image.createImage("/res/abc.png");
    Label text = new Label(image);
    text.setAlignment(Component.CENTER);
    ....................................

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    5

    Smile Re: alignment of image in button

    thanks alot.It worked

Similar Threads

  1. Replies: 2
    Last Post: 2011-01-18, 12:01
  2. problem in display an image button on canvas(Background image)
    By mramin05 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2008-11-12, 04:51
  3. right alignment of text in navigation pane
    By himsymbian in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-10-07, 08:30

Posting Permissions

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