Skip to main content

How to Initialize ContainerList with selectedItem?

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2010-08-23


I have a List object which is filled with rows from a sqlite database. One of the list items is made the selected item when initializing and the List is configured with List.FIXED_LEAD. The ContainerList is then created based on the getModel of the List. I would expect the ContainerList to take over the selection of the ListModel of the List but it is completly ignoring it. How can i initialize the ContainerList with a selected item at the top of the List?

This is the code i use to create the ContainerList:



ContainerList cntCountriesList = new ContainerList(lstCountries.getModel());

Reply viewing options

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

The container list should "jump" to the selected entry when the model changes or has a none-zero selected index.

I'm not exactly sure I understand the problem description, can you illustrate it with a sample use?