Java Reference
In-Depth Information
Figure 1.6
Hello World
Listing 1.2
Cool Hello World Application
package myfirstjavafxapplication;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.effect.Reflection;
var stage:Stage = Stage {
title: "My first JavaFX Application"
visible: true
width: 400
height: 200
scene: Scene {
var text:Text;
content: [
Rectangle {
width: bind stage.width
height: bind stage.height
fill: LinearGradient {
endY: 1, endX: 0
stops: [
Stop {offset: 0.0
color: Color.rgb(153, 153, 153);
},
Stop {offset: 0.5
color: Color.WHITE;
},
Stop { offset: 1.0
color: Color.rgb(153, 153, 153);
continues
Search WWH ::




Custom Search