Skip to content

Instantly share code, notes, and snippets.

@RCura
Created April 17, 2013 14:48
Show Gist options
  • Select an option

  • Save RCura/94e8e5e8add8a6ebb8ab to your computer and use it in GitHub Desktop.

Select an option

Save RCura/94e8e5e8add8a6ebb8ab to your computer and use it in GitHub Desktop.
drge
package rcfx
import scalafx.Includes._
import scalafx.application.JFXApp
import scalafx.scene.Scene
import scalafx.scene.paint.Color
import scalafx.scene.shape.Rectangle
import scalafx.stage.Stage
object World extends JFXApp {
stage = new JFXApp.PrimaryStage {
title = "Hello World"
width = 600
height = 450
scene = new Scene {
fill = Color.LIGHTGREEN
root = new Rectangle {
x = 25
y = 40
width = 100
height = 100
fill <== when(hover) then Color.GREEN otherwise Color.RED
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment