Search code examples
java-melwuit

How to go to the top or bottom of a List when the bottom or top is reached when scrolling?


There is a list based on an array of Commands , myList = new List(new Command[] {cmd1, cmd2}) .

I want that when scrolling upwards and reaching the top of the list I want to go to its last element ( at the bottom ) , and when scrolling downwards and reaching the last element at the bottom I want to go to its first element ( at the top ) . How to achieve that ?

Thank you very much


Solution

  • use myList.setFixedSelection(List.FIXED_NONE_CYCLIC);