add old scala exercises
This commit is contained in:
parent
cff314486c
commit
c3408fb74a
3 changed files with 60 additions and 0 deletions
23
ScalaFXHello.scala
Normal file
23
ScalaFXHello.scala
Normal file
|
@ -0,0 +1,23 @@
|
|||
import scalafx.Includes._
|
||||
import scalafx.application.JFXApp
|
||||
import scalafx.scene.Scene
|
||||
import scalafx.scene.paint.Color
|
||||
import scalafx.scene.shape.Rectangle
|
||||
|
||||
object ScalaFXHello extends JFXApp {
|
||||
stage = new JFXApp.PrimaryStage {
|
||||
title.value = "Hello Stage"
|
||||
width = 600
|
||||
height = 450
|
||||
scene = new Scene {
|
||||
fill = Color.LightGreen
|
||||
content = new Rectangle {
|
||||
x = 25
|
||||
y = 40
|
||||
width = 100
|
||||
height = 100
|
||||
fill <== when (hover) choose Color.Green otherwise Color.Red
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue