【发布时间】:2016-10-23 20:20:38
【问题描述】:
所以我在 scala 中有以下简单程序:
object CViewerMainWindow extends SimpleSwingApplication {
var i = 0
def top = new MainFrame {
title = "Hello, World!"
preferredSize = new Dimension(320, 240)
// maximize
visible = true
contents = new Label("Here is the contents!")
listenTo(top)
reactions += {
case UIElementResized(source) => println(source.size)
}
}
.
object CViewer {
def main(args: Array[String]): Unit = {
val coreWindow = CViewerMainWindow
coreWindow.top
}
}
我曾希望它会创建一个普通的窗口。相反,我得到了这个:
【问题讨论】:
标签: swing scala scala-swing