Skip to main content

"Million Contacts" Problem - List Cyclic Scrolling

2 replies [Last post]
Joined: 2009-03-12

Hello all!
I've tried to make a list using this tutorial:

My problem is that I cannot select elements of the list, and that the list is cyclic. I don't want the list be cyclic...
This is my code that describes the properties of the list (in my case it is questions renderer):

l.setListCellRenderer(new QuestionsRenderer());
f.setLayout(new BorderLayout());
f.addComponent(BorderLayout.CENTER, l);

What should I do?

Many Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2009-03-12

Hi all!
The problem were fixed!

The solution is:
1. l.setFixedSelection(List.FIXED_NONE);
2. In this code:
List l = new List(new ListModel() {
private int selection;
public Object getItemAt(int index) {
return contactArray[index % contactArray.length];

public int getSize() {
return 1000000;

public int getSelectedIndex() {
return selection;

public void setSelectedIndex(int index) {
selection = index;

public void addDataChangedListener(DataChangedListener l) {

public void removeDataChangedListener(DataChangedListener l) {

public void addSelectionListener(SelectionListener l) {

public void removeSelectionListener(SelectionListener l) {

public void addItem(Object item) {

public void removeItem(int index) {
you should change the getSize number to contactArray.length

Joined: 2008-10-21