Montag, 25. April 2011

GuiHello.scala

//GuiHello.scala

import scala.swing._

object GuiHello extends SimpleSwingApplication {
def top = new MainFrame {
title = "Greetings"
var x=400 : Int
var y=300 : Int
preferredSize = new Dimension (x, y)

val label = new Label {
text ="Welcome to Scala.."
font = new java.awt.Font("Verdana", java.awt.Font.BOLD,22)
}

contents = new GridBagPanel {
var c = new Constraints
c.gridwidth = java.awt.GridBagConstraints.REMAINDER
add(label,c )
background = java.awt.Color.yellow
border = Swing.EmptyBorder(15,15,15,15)
}
}
}



Keine Kommentare: