Skip to main content

Rounded border with Thickness and Color

3 replies [Last post]
shankar_vn
Offline
Joined: 2009-11-03
Points: 0

I knew that this can be done for line border

<br />
lbl.getStyle().setBorder(Border.createLineBorder(4, 0x2f83));<br />
lbl.getSelectedStyle().setBorder(Border.createLineBorder(4, 0x2f83));<br />

but never found similar method for Rounded borders.

Is there any way to add rounded border with some thickness and some custom Color to a Component?? (Shouldn't be officially, But at least through some hacks..)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ghady_rayess
Offline
Joined: 2009-01-09
Points: 0

You cannot have rounded borders with thickness.

Have you tried the 9 images border?

shankar_vn
Offline
Joined: 2009-11-03
Points: 0

If that is the only solution, i should try it.

I am just looking for a "light weight" solution.

Does anyone tried to achieve a rounded border with thickness?

ntaz
Offline
Joined: 2010-02-06
Points: 0

I don't think it'll be much trouble doing it using a custom painter. On some devices Math.sqrt() is problematic, so you can have pre-set values for corner's radius for, let's say, up to 20 pixels think.

/ntaz