示例代码:
package com.dt.scala.gui
import scala.swing.SimpleSwingApplication
import scala.swing.MainFrame
import scala.swing.Button
import scala.swing.Label
import scala.swing.Orientation
import scala.swing.BoxPanel
import scala.swing.Swing
object GUI_Panel_Layout extends SimpleSwingApplication{
def top = new MainFrame{
title = "Second GUI"
val button = new Button{
text = "Scala"
}
val label = new Label {
text = "Here is Spark!!"
}
contents = new BoxPanel(Orientation.Vertical){
contents += button
contents += label
border = Swing.EmptyBorder(50,50,50,50)
}
}
}
效果图:
相关来源:DT大数据梦工厂,微信公众号是DT_Spark,每天都会有大数据实战视频发布,请您持续学习。
相关资料:
scala深入浅出实战经典完整视频、PPT、代码下载:
百度云盘:http://pan.baidu.com/s/1c0noOt6
腾讯微云:http://url.cn/TnGbdC
360云盘:http://yunpan.cn/cQ4c2UALDjSKy 访问密码45e2