Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codename one container background color

Tags:

codenameone

I am trying to change the background color for a specific container with this line of code :

Container container = new Container(new BorderLayout());
container.getStyle().setBgColor(0x99CCCC);

but nothing happens, i used also repaint() but also nothing. the same with setBgTransparency(0)

like image 633
Fahd Lihidheb Avatar asked Mar 10 '23 06:03

Fahd Lihidheb


2 Answers

If you want to format the container or change style of the container, then you just have to create UIID in designer for container, Here you can format background color, margin, padding, etc. So you just have to create UIID and apply it to specific container.

For example:-

Container container = new Container();
container.setUIID("Container_uiid_name");

and you achieve the expected output.

like image 101
Gaurav Takte Avatar answered May 16 '23 08:05

Gaurav Takte


setBgTransparency(0) make container to transparent so setBgTransparency to 255 to make it opaque . And hope the following codes will help you

Container container = new Container(new BorderLayout());
container.getStyle().setBgColor(0x99CCCC);
container.getStyle().setBgTransparency(255);
like image 39
tizbn Avatar answered May 16 '23 07:05

tizbn