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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Trusted Contributor
Posts: 138
Registered: ‎04-19-2012
My Device: No
My Carrier: Nokia

How to add Square box with color without hard Coded.

I am try to create a custom list with Label and square box with color. I am able to having a Label in my list but not square . 

 

How can i add this .

Developer
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: How to add Square box with color without hard Coded.

can we see snapshots of screen you wanted?
Trusted Contributor
Posts: 138
Registered: ‎04-19-2012
My Device: No
My Carrier: Nokia

Re: How to add Square box with color without hard Coded.

Aman there is no specific design for that .

 

 

Label                                         [  ]

Label                                         [  ]

 

like this. these are square boxs

Developer
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: How to add Square box with color without hard Coded.

So you want something like buttons i.e for square brackets
you can say square buttons you want to create
Highlighted
Trusted Contributor
Posts: 138
Registered: ‎04-19-2012
My Device: No
My Carrier: Nokia

Re: How to add Square box with color without hard Coded.

can we not do this thing if i make 3 character whitespace in label.setText("    "); and set the color in that . so will it look like square or rect.

Developer
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: How to add Square box with color without hard Coded.

Try this code:

 

HorizontalFieldManager horizontalFieldManager = new HorizontalFieldManager()
        {
            protected void setExtent(int width, int height)
            {
                super.setExtent(75, 50);
            }
        };
        horizontalFieldManager.setBackground(BackgroundFactory.createSolidBackground(Color.RED));
        LabelField labelField = new LabelField();
        horizontalFieldManager.add(labelField);
        add(horizontalFieldManager);


hope this is what u want?

 

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

Re: How to add Square box with color without hard Coded.

[ Edited ]

What is the purpose of this 'square'?  Is it just a square on the screen or does the user interact with it?