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
rakesh86shankar
Posts: 987
Registered: ‎05-22-2009
My Device: Not Specified

about borders

 can i change the color of border ?

if posiible how?

 

 

 

 Border border = BorderFactory.createSimpleBorder(edges);

 

 

thanks

 

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: about borders

Check this method of BorderFactory:

 

public static Border createSimpleBorder(XYEdges edges,
                                                           XYEdges colors,
                                                              int style)

    Create a simple border with specified colors and style.

    Parameters:
        edges - XYEdges object representing the width/thickness of the border's four sides in pixels.
        colors - XYEdges object representing the colors of the border's four sides in 0xAARRGGBB format (includes alpha channel).
        style - STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
    Returns:
        Border object representing a simple border.

 

 

 

Please use plain text.
Developer
rakesh86shankar
Posts: 987
Registered: ‎05-22-2009
My Device: Not Specified

Re: about borders

how to create XYEdges Color?

i can t get it

 

Can u expain in detail

 

this is my code

 

XYEdges edges = new XYEdges(20, 20, 20, 20);
   int sz=Border.STYLE_FILLED;
   i   Border border = BorderFactory.createSimpleBorder(edges, ,sz);
   border.getBackground();
   fm.setBorder(border);

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: about borders

I am sorry, but I did not use this method before.

 

And I did not check how exactly does it operate with XYEdges color parameters.

Please use plain text.
Developer
jlfrias
Posts: 108
Registered: ‎01-29-2009
My Device: BlackBerry 8700g
My Carrier: Tigo

Re: about borders

Hi

 

I have use the following implementation:

 

I have the create the following image:

 

 

This image have a specific color edge and background.

 

In the application you can use the following code:

 

 

private VerticalFieldManager _manager; Background image_background = BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource(nameImage.png), 0, 0, Background.REPEAT_INHERIT); _manager.setBackground(image_background); /** Manager for the text that will add to the container. */ _container_text = new VerticalFieldManager(); /** Borders for Rounded content */ XYEdges rounded_edges = new XYEdges(11, 11, 11, 11); Border rounded_content = BorderFactory.createBitmapBorder(rounded_edges, Bitmap.getBitmapResource(_resources.getString(IMAGE_BOX))); _container_text.setBorder(rounded_content); String _textField = _seed.getElement(HopperData.PROBLEM_DESCRIPTION); String _dateField = new DateField("Entered: ", date.getTime(), sdFormat); _manager.add(_container_text); _container_text.add(_dateField); _container_text.add(new SeparatorField()); _container_text.add(_textField);

 

The Resutl is:

 

 

 

 With this method you can change the edge and background of your screen.

 

If You have any questions let me know.

 

Thanks

Jorge Luis

 

 

Jorge Luis Frias B

Leader on Development
BlackBerry/iPhone Technologies
Please use plain text.
Developer
rakesh86shankar
Posts: 987
Registered: ‎05-22-2009
My Device: Not Specified

Re: about borders

ur code worked,and i get a image around the frame,but how to get the colors in the border,

can u tell plz

thanks

Please use plain text.
Developer
jlfrias
Posts: 108
Registered: ‎01-29-2009
My Device: BlackBerry 8700g
My Carrier: Tigo

Re: about borders

You will create the box with the preferred color. This is a image, not code.

 

thanks

Jorge Luis Frias B

Leader on Development
BlackBerry/iPhone Technologies
Please use plain text.
New Developer
Jeyaram86
Posts: 6
Registered: ‎07-21-2009
My Device: Not Specified

Re: about borders

1.use XYRect method
2.assign this to BorderorderFactory.createBitmapBorder();

3.setBordet();

Please use plain text.
Developer
rakesh86shankar
Posts: 987
Registered: ‎05-22-2009
My Device: Not Specified

Re: about borders

createSimpleBorder(XYEdges edges, XYEdges colors, XYEdges style)
          Create a simple border with specified colors and styles.

 

 

what this color denotes can u help me 

 

i want the colors instead of imagees,that's what required

Please use plain text.