第71讲:Scala界面Panel、Layout实战详解
学习笔记:
可以利用panel进行布局,如可以设定离上下左右的距离,
panel内部可以放很多复杂的元素,
panel有很多子类,不同子类包含元素不一样,而已也不一样。
实战代码:
import scala.swing._
object GUI_Panel_Layout extends SimpleSwingApplication {
def top = new MainFrame {
title = "Second GUI"
val button = new Button {
text = "Scala"
}
val label = new Label { //label是标签,无法改变
text = "Here is Spark!!!"
}
contents = new BoxPanel(Orientation.Vertic