Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Regular Contributor
Posts: 59
Registered: ‎03-06-2012
My Device: 9700
My Carrier: airtel
Accepted Solution

Issue in title bar and label field scroll

Hi All,

 

     I have a title bar and just below that i have a label field,i am facing a issue like as and when i scroll down the lable field "timezoneTitle " is not visible.Its visible only when i scroll up.I want to keep it fixed even if the user scrolss up and down,how to handle this?

 

LabelField title= new LabelField("welcome", LabelField.FIELD_RIGHT);

hfm.add(title);

  

// title for timezone
  LabelField timezoneTitle = new LabelField("", LabelField.ELLIPSIS
            | LabelField.USE_ALL_WIDTH | LabelField.FIELD_HCENTER) {
        public void paint(Graphics graphics) {
            graphics.setColor(Color.WHITE);
            graphics.setBackgroundColor(Color.BLUE);
            graphics.clear();
            super.paint(graphics);
        }
    };

setTitle(vm);

add(timezoneTitle );

 

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Issue in title bar and label field scroll

I'm not sure I understand the question, nor that the code you supplied is complete, but if my understanding is correct, then try this

 

VertticalFieldManager vfm = new VerticalFieldManager();

 

LabelField title= new LabelField("welcome", LabelField.FIELD_RIGHT);

vfm.add(title);

 

// title for timezone
  LabelField timezoneTitle = new LabelField("", LabelField.ELLIPSIS
            | LabelField.USE_ALL_WIDTH | LabelField.FIELD_HCENTER) {
        public void paint(Graphics graphics) {
            graphics.setColor(Color.WHITE);
            graphics.setBackgroundColor(Color.BLUE);
            graphics.clear();
            super.paint(graphics);
        }
    };

vfm.add(timeZoneTitle)

setTitle(vm);

 

If this does not solve you problem, and actually even if it does, I recommend that you review this:

http://supportforums.blackberry.com/t5/Java-Development/MainScreen-explained/ta-p/606644