第71讲 Scala界面Panel、Layout

来源:互联网 发布:我们都是超能力者 知乎 编辑:程序博客网 时间:2024/06/13 10:16

实例代码如下

/** * Created by zhiwang on 2015/7/28. */import scala.swing.SimpleSwingApplicationimport scala.swing.MainFrameimport scala.swing.Buttonimport scala.swing.Labelimport scala.swing.Orientationimport scala.swing.BoxPanelimport scala.swing.Swingobject 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)    }  }}

运行效果
这里写图片描述

参考文档
百度网盘:http://pan.baidu.com/share/home?uk=4013289088#category/type=0
微信号:18610086859
DT大数据微信公众账号:DT_Spark
DT大数据梦工厂交流群:462923555/418110145/437123764

0 0
原创粉丝点击