Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Main extends App {
- Swing.onEDT {
- (new MainFrame {
- val lv = new ListView[String](Seq("Apple", "Banana", "Cherry"))
- lv.selection.intervalMode = IntervalMode.Single
- listenTo(lv.selection)
- reactions += {
- case SelectionChanged(`lv`) => {
- lv.selection.items.headOption.foreach(item => println(item))
- }
- }
- contents = lv
- }).visible = true
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement