Skip to main content
100%

drge

✓ Published0🌍 Public
RRCura
Last edited Apr 17, 2013
Created on Apr 17, 2013

This example demonstrates a simple interactive color-changing rectangle inside a ScalaFX application. It shows a basic JavaFX scene with a green background and a square that toggles between red and green when the mouse hovers over it. The code uses ScalaFX’s `JFXApp`, `Scene`, and `Rectangle` APIs, along with a binding expression (`fill <== when(hover)`) to trigger the color change. The rectangle is drawn directly as a shape node, with no external data source.

AI-generated description

Similar vizzes