I am trying to write a mini file browser where I show a list of files, and replace the list with another when I change directories.
I can display a list:
val myList = List("Paris", "New York", "Tokyo", "Berlin", "Copenhagen")
val myListBuffer = new ListBuffer[String] ()
myListBuffer.appendAll(myList)
val myListView = new ListView(myListBuffer)
...
contents += myListView
In response to the event, I want to change the displayed content. Most of what I tried makes the list βinvisibleβ (but still responds with a choice of up and down arrows) - sometimes by making items invisible only when they are selected!
How to update ListView to reflect new ListBuffer content? Or can someone point me to an example of this?
Thank.
source
share