×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    4

    Lwuit label problem

    hi every1
    My first problem is that i added a label to the theme i created,but the label is having a border around it.This border is having the colour of theme.
    My second problem is that i added an exit button to the theme,but it was immediately placed on the left hand side.the button is the only command i want to add to theme and i want it on the right side.I also dont know if it is possible for the button to be added without the horizontal bar that comes with it.


    My code is below:

    public class Ruwwa extends javax.microedition.midlet.MIDlet implements ActionListener{

    Form f;
    Button mybutton1;
    Button mybutton2;
    Command Exit ;

    public void startApp() {

    Display.init(this);

    f = new Form();
    f.setLayout(new CoordinateLayout(200, 200));

    try {

    Resources r = Resources.open("/mairuwa.res");
    UIManager.getInstance().setThemeProps(r.getTheme("Mairuwa Theme"));

    } catch (IOException ioe) {
    ioe.printStackTrace();
    }

    UIManager.getInstance().getLookAndFeel().setReverseSoftButtons(true);

    mybutton1=new Button("Report A Problem");
    mybutton2=new Button("Request Info");

    Label lb1 = new Label("Welcome to Mairuwa");
    lb1.setX(10);
    lb1.setY(60);
    lb1.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_MEDIUM));

    Label lb2 = new Label("I Want to:");
    lb2.setX(10);
    lb2.setY(100);
    lb2.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_MEDIUM));

    Exit = new Command("Exit");

    f.addComponent(lb1);
    f.addComponent(lb2);
    f.addCommand(Exit);

    f.show();

    }
    }


    ALso attached is the image of my emulator and also the image of what i am trying to achieve

    my emulator image:

    http://imageshack.us/photo/my-images...itproblem.png/

    the image i am working towards:

    http://imageshack.us/f/502/homeyfl.jpg/

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Lwuit label problem

    Hi barafyzil,

    Regarding your second problem, the Commands are placed with order, the first one to the left and the second one to the right. Try creating an empty Command, add the empty command first, and then add your Exit command. That should place your Exit command to the bottom right.

    Regarding your first question, what happens if you set the label's border to zero?
    Code:
    lb1.getStyle().setBorder((Border.createLineBorder(0, 0x000000)));

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    4

    Re: Lwuit label problem

    @skalogir I treid it and it didnt work.Pls wot else can i do.thanks

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Lwuit label problem

    Hi barafyzil,

    Did you manage to get the command on the bottom right corner?

    Regarding the issue of your label getting the color of your theme, do you mean that the background of the label was filled with the background color of your theme (the border is something else, i.e. what surrounds the label)?
    If that's the case, you can change the background color of the label by using this code:
    Code:
    lb1.getStyle().setBgColor(0xd5fff9);
    you can choose the same color as the color of the area where the label is placed, so that the background of the label doesn't look painted.

  5. #5
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Lwuit label problem

    Hi barafyzil,

    Did you manage to get the command on the bottom right corner?

    Regarding the issue of your label getting the color of your theme, do you mean that the background of the label was filled with the background color of your theme (the border is something else, i.e. what surrounds the label)?
    If that's the case, you can change the background color of the label by using this code:
    Code:
    lb1.getStyle().setBgColor(0xffffff);
    you can choose the same color as the color of the area where the label is placed, so that the background of the label doesn't look painted.

Similar Threads

  1. How to play gif on Label in lwuit?
    By mohammad_kaied in forum Mobile Java General
    Replies: 1
    Last Post: 2011-10-10, 15:50
  2. Label problem
    By zhenLeow in forum Symbian
    Replies: 3
    Last Post: 2010-08-11, 14:14
  3. LWUIT: line breaks in Label
    By psorobka in forum Mobile Java General
    Replies: 2
    Last Post: 2009-08-05, 15:42
  4. Label display Problem
    By joseph.m in forum Symbian
    Replies: 1
    Last Post: 2009-01-06, 07:42
  5. Problem in using LABEL control
    By Nokia_Archive in forum Symbian User Interface
    Replies: 1
    Last Post: 2002-05-30, 12:36

Posting Permissions

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