handle{...} was introduced to simplify creation of event handlers.
Starting with Scala 2.12 handle{...} can be replaced with idiomatic Scala code _ => {...}. For instance, instead of old:
button.onAction = handle {
println("Handling button action")
doSomething()
}
we can now write:
button.onAction = _ => {
println("Handling button action")
doSomething()
}
handle{...}was introduced to simplify creation of event handlers.Starting with Scala 2.12
handle{...}can be replaced with idiomatic Scala code_ => {...}. For instance, instead of old:we can now write: