Amrit
Amrit

Reputation: 38

How to set background transparency and color to VerticalFieldManager and/or HorizontalFieldManager?

The following code isn't working, I would appreciate some help.

HorizontalFieldManager hfm = new HorizontalFieldManager();
hfm.setBackground(BackgroundFactory.createSolidTransparentBackground(Color.BLACK, 0));

Upvotes: 0

Views: 684

Answers (1)

Rupak
Rupak

Reputation: 3674

You are using 0 as alpha value on createSolidTransparentBackground(int color, int alpha).

It will create a fully transparent background (not visible). Check the range of the alpha value in documentation.

It says, alpha - 0 (clear) to 255 (opaque). Try other values for alpha, e.g. 127.

Upvotes: 1

Related Questions