Skip to main content

dlcr.getSelectedStyle.setBgColor() does not work

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2011-11-25

Hi all

I'm newbie to lwuit.

I've created a simle list, but I can't set the bg color for selected items. Of course bgColor works for Unselected items.

By the way, other styles such as font and fgColor works for selected items.

Here's my code:


String[] items = {"Red", "Green","Blue"};

DefaultListModel simpleModel = new DefaultListModel();

DefaultListCellRenderer dlcr = new DefaultListCellRenderer();

List lst = new List(simpleModel);



But the result is a white rectangle arount the selected item


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-11-07

I'm guessing the items transparency is 0 which is why you see this. However, what you would want to customize is the color of the focus component which is the element that moves behind the selected item.