Skip to main content

Combo box item not shown selected

3 replies [Last post]
niveditajain2002
Offline
Joined: 2011-08-19
Points: 0

I have added combo box on my LWUIT form

In all the combo box, selected item does not highlight. All items look same.

What is the property to do this??

Reply viewing options

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

You need to use the "Selected" style for ComboBoxItem and ComboBoxFocus.

ComboBoxItem - The actual item content which we usually recommend keeping transparent.

ComboBoxFocus - the selection background that is animated (slides) when scrolling within the combo box or list.

niveditajain2002
Offline
Joined: 2011-08-19
Points: 0

hey vprise

Thanx for ur precious advice but i didnt came to know how the actually it will be implemented

Plz help me out

few lines of my code are

private ComboBox initilize_ComboBox(String[] fields){
ComboBox conCombo = new ComboBox(fields);
DefaultListCellRenderer dlcr = (DefaultListCellRenderer)conCombo.getRenderer();
dlcr.getStyle().setFgColor(0x4d80d0);
dlcr.getStyle().setBgColor(0x0000FF);
return conCombo;

}

vprise
Offline
Joined: 2003-11-07
Points: 0

My answer explained how YOU should customize this. The colors are derived from the theme and you need to install a theme that includes styles for the properties I listed above.