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
Developer
Posts: 209
Registered: ‎11-08-2008
My Device: Not Specified

Re: Re: Re: progress Bar display

Hello dear,its not full code,its just part of the code. I have tried to rectify part of code that was wrong. If you want to understand it then first run his earlier code,and then keep on changing it step by step.
Thanks and Regards
Developer
Posts: 155
Registered: ‎05-20-2009
My Device: Not Specified

Re: progress Bar display

Thanks a lot...It works fine..

 

I want to set background color for title only........not for progressbar...how to set that.Plz help me out.

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: progress Bar display

Dn't knw u tried it or not, I ma posting this thing again here. This works perfectly fine for me. I can change the font and also the Background Color.

class CustomLabelField extends LabelField { public CustomLabelField(String s) { super(s,Field.USE_ALL_WIDTH); try{ FontFamily ff = FontFamily.forName("BBMillbankTall"); Font font = ff.getFont(FontFamily.SCALABLE_FONT, 20).derive(Font.PLAIN); }catch(Exception e) { } setFont(font); } public void paint(Graphics g) { g.setColor(Color.YELLOW); g.setBackgroundColor(Color.DARKRED); g.clear(); super.paint(g); } }

 

PS: I Suggest you to Go thru the Sticky thread, It has a good docs for new developers. Dn't directly jump to your requirement directly, go thru the basic stpes and the API's, examples avaialble you will be very comfortable to start to fulfil requirements.

 

 

 http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=13264


Use Search. "Accept Solution" If the problem is resolved.
Highlighted
Developer
Posts: 209
Registered: ‎11-08-2008
My Device: Not Specified

Re: progress Bar display

Try this :) public ProgressScreen() { super(new VerticalFieldManager()); LabelField title = new LabelField("Welcome to Reliance",LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH) { public void paint(Graphics g) { g.setColor(Color.YELLOW); g.setBackgroundColor(Color.DARKRED); g.clear(); super.paint(g); } }; try{ FontFamily ff = FontFamily.forName("BBMillbankTall"); Font font = ff.getFont(FontFamily.SCALABLE_FONT, 3).derive(Font.PLAIN); }catch(Exception e){} title.setFont(font); add(title); percentGauge = new GaugeField("Please Wait.... ", 0, 100, 0,GaugeField.PERCENT); add(percentGauge); timer = new Timer(); timer.schedule(new RemindTask(),500,500); }

 

Thanks and Regards