import scala.swing._
import swing.event.{WindowClosing}
import java.awt.Dimension
object MenuBarTest {
def main(args:Array[String]) {
val frame = new Frame() {
visible=true
contents = new Panel() {
preferredSize = new Dimension(600,400)
}
title = "Test"
reactions += {
case WindowClosing(e) => System.exit(0)
}
menuBar = new MenuBar {
contents += new Menu("A Menu") {
contents += new MenuItem("An item")
contents += new MenuItem(Action("Action item") { println(title) })
contents += new Separator
contents += new CheckMenuItem("Check me")
}
}
}
}
}
The instant I resize the window, the menu pops in.
Any idea why this is and how I can prevent this from happening?