it's probably really easy to solve but since I'm really new to scala I even don't know what I don't know.
I have to write a simple application that rewrites input text to output text field after 'Enter' key is hit.
object Main extends SimpleSwingApplication {
def top = new MainFrame {
title = "Text Fields"
preferredSize = new Dimension(200, 90)
val inText = new TextField(10)
val outText = new TextField(10)
outText.editable = false
val inLabel = new Label("input")
val outLabel = new Label("output")
inText.listenTo(inText.keys)
inText.reactions += {
case EditDone(e) => println("aaaa") ; outText.text = e.text
}
contents = new FlowPanel(){
contents += inLabel
contents += inText
contents += outLabel
contents += outText
}
}
}
the EditDone event does not fire up for some reason. The KeyPressed event works as it should end I know I could check if it's 'enter' key but since there is special event for my case I wish I could use it.