summaryrefslogtreecommitdiff
path: root/docs/examples/swing/ListViewDemo.scala
blob: 5630f2871d6331d2d1e7f2a4afe920908b3ddd83 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package examples.swing

object ListViewDemo extends SimpleSwingApplication {
  def top = new MainFrame {
    case class City(name: String, country: String, population: Int, capital: Boolean)
    val items = List(City("Lausanne", "Switzerland", 129273, false),
                              City("Paris", "France", 2203817, true),
                              City("New York", "USA", 8363710 , false),
                              City("Berlin", "Germany", 3416300, true),
                              City("Tokio", "Japan", 12787981, true))
    import ListView._
    contents = new FlowPanel(new ScrollPane(new ListView(items) {
      renderer = Renderer(_.name)
    }))
                             //new ScrollPane(new Table(items)))
  }
}