I am having a problem closing my Scala swing frame. Here is the code for my exit button
val buttonExit = new Button {
text = "Exit"
action = Action("Exit") {
WorldActor.run(false)
closer
}
}
The closer function is defined as:
def closer (){
top.close
}
where top is the MainFrame. Everytime I try to close, it just suspends and stops responding.
It seems like you can call
on the Frame.
disposeis implemented onscala.swing.Windowso applies to Frames and Dialogs.Calling
disposecloses (in a recoverable way, usingpackandvisible = trueto re-open) additional Frames and terminates the application, if called on the last Frame.To terminate the app on any Frame call
quit()which calls any shutdown code provided before calling System.exit.Here’s a quick hack to illustrate