×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor
    Join Date
    Nov 2012
    Location
    Karachi
    Posts
    89

    LWUIT FT - Header Bar Color

    I want to change the Header Bar Colour ..
    I am using LWUIT and developing ASHA full touch app .. please can someone share the code that how can I change the colour of Header Bar.
    Shayan Rais (0344-2621149)
    Undergraduate - Computer & Information Systems Engineer (NED University)

    Facebook : https://www.facebook.com/messdevelopers
    Twitter : https://twitter.com/messdevelopers

  2. #2
    Nokia Developer Champion
    Join Date
    Aug 2010
    Location
    Ahmedabad
    Posts
    299

    Re: LWUIT FT - Header Bar Color

    Nokia SDK 2.0

    Try out these codes
    Code:
    FormName.getTitleComponent().getStyle().setBgColor(0Xe30c0c);
    OR
    Code:
    FormName.getTitleStyle().setBgColor(0Xe30c0c);

  3. #3
    Nokia Developer Champion
    Join Date
    Aug 2010
    Location
    Ahmedabad
    Posts
    299

    Re: LWUIT FT - Header Bar Color

    You can also create a theme using ResourceEditor and apply the theme using following code.

    Code:
     try {
                Display.init(this);
    
                Resources r = Resources.open(getClass().getResourceAsStream("/theme.res"));
                System.out.println("Under rasource.open");
                UIManager.getInstance().setThemeProps(r.getTheme("sampleTheme"));
            } catch (Exception e) {
                e.printStackTrace();
            }

  4. #4
    Regular Contributor
    Join Date
    Nov 2012
    Location
    Karachi
    Posts
    89

    Re: LWUIT FT - Header Bar Color

    Quote Originally Posted by girishpadia View Post
    Nokia SDK 2.0

    Try out these codes
    Code:
    FormName.getTitleComponent().getStyle().setBgColor(0Xe30c0c);
    OR
    Code:
    FormName.getTitleStyle().setBgColor(0Xe30c0c);
    Thank you girishpadia for reply!
    But these Codes are Not Working!
    Shayan Rais (0344-2621149)
    Undergraduate - Computer & Information Systems Engineer (NED University)

    Facebook : https://www.facebook.com/messdevelopers
    Twitter : https://twitter.com/messdevelopers

  5. #5
    Nokia Developer Champion
    Join Date
    Aug 2010
    Location
    Ahmedabad
    Posts
    299

    Re: LWUIT FT - Header Bar Color

    Quote Originally Posted by Shayan Rais View Post
    Thank you girishpadia for reply!
    But these Codes are Not Working!
    Have a try to create a theme and attache it with your application.

    Quote Originally Posted by girishpadia View Post
    You can also create a theme using ResourceEditor and apply the theme using following code.

    Code:
     try {
                Display.init(this);
    
                Resources r = Resources.open(getClass().getResourceAsStream("/theme.res"));
                System.out.println("Under rasource.open");
                UIManager.getInstance().setThemeProps(r.getTheme("sampleTheme"));
            } catch (Exception e) {
                e.printStackTrace();
            }

  6. #6
    Regular Contributor
    Join Date
    Dec 2012
    Location
    Indonesia,DKI Jakarta
    Posts
    87

    Re: LWUIT FT - Header Bar Color

    I am developing an application and need to change the color of header bar from black to RED. So, is it working if i use theme or i must go through the LWUIT source code to change the color...?

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: LWUIT FT - Header Bar Color

    Hello Muhamad.iqbal

    the best way would be to try the two ways already mentioned in the thread. Resource solution works afaik !!

  8. #8
    Regular Contributor
    Join Date
    Dec 2012
    Location
    Indonesia,DKI Jakarta
    Posts
    87

    Re: LWUIT FT - Header Bar Color

    Ok gaba88, I am gonna try those ways.

  9. #9
    Regular Contributor
    Join Date
    Dec 2012
    Location
    Indonesia,DKI Jakarta
    Posts
    87

    Re: LWUIT FT - Header Bar Color

    gaba88, i already try with the resource theme then it impact to my UI. my label, my textfield was broken. My goal is like this image:



    Quote Originally Posted by gaba88 View Post
    Hello Muhamad.iqbal

    the best way would be to try the two ways already mentioned in the thread. Resource solution works afaik !!


    You see, the header with the word Facebook is blue. Any idea, how to change header bar color,like those picture...?


    Best Regards,
    Iqbal

  10. #10
    Regular Contributor
    Join Date
    Nov 2012
    Location
    Karachi
    Posts
    89

    Re: LWUIT FT - Header Bar Color

    I have tried using the theme for changing the background of the HEADER BAR but it isn't working. Neither the foreground nor the background of the titlebar is changing. The theme is working on all other components (buttons etc) but not on HEADER BAR.

    Anyone ?
    Shayan Rais (0344-2621149)
    Undergraduate - Computer & Information Systems Engineer (NED University)

    Facebook : https://www.facebook.com/messdevelopers
    Twitter : https://twitter.com/messdevelopers

  11. #11
    Registered User
    Join Date
    Jun 2013
    Posts
    1

    Re: LWUIT FT - Header Bar Color

    @Shayan Rais

    I am facing same issue. If you found solution of this Problem. kindly share here.

    Thanks

    Jahanzaib Aslam

  12. #12
    Registered User
    Join Date
    Feb 2013
    Location
    Madrid
    Posts
    84

    Re: LWUIT FT - Header Bar Color

    I'm building the same type of header bar for my app and this works!

    The getTitleComponent and more methods, doesn't work. What you need to do is set your app to full screen and create the custom header by yourself and hold it to the top of the Form (usign borderlayout is easy and not scrollable form).

    You will lose the navigation items, like the menuBar and BackCommand, and all the others commands.

    The simple commands can be implemented using the PopupList component.

    I recommend to take a look to my post in stackoverflow to implement the back button.

    http://stackoverflow.com/questions/1...it-back-button

Similar Threads

  1. Replies: 3
    Last Post: 2012-08-06, 07:25
  2. backselection color of list in LWUIT (reply fast please)
    By kavitha@i-waves.com in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2010-08-28, 08:04
  3. LWUIT - set button color
    By burinutit in forum Mobile Java General
    Replies: 6
    Last Post: 2009-11-27, 15:34
  4. change background color of Form in LWUIT
    By jackofall in forum Mobile Java General
    Replies: 1
    Last Post: 2009-05-19, 05:26
  5. color information from png image header
    By neha_rashi in forum Mobile Java General
    Replies: 0
    Last Post: 2008-02-17, 12:53

Posting Permissions

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