All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.swing.test.ListViewDemo.scala Maven / Gradle / Ivy

There is a newer version: 2.11.0-M7
Show newest version
package scala.swing
package test

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)))
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy