Recent changes Random page
GAMING
Technology
 
Gaming
Entertainment
Science Fiction
Biggest wikis
Hobbies
Music
See more...

Fullscreen window example

From Planet JFX

Jump to: navigation, search
 

This is a simple example showing "Hello World" centered on a fullscreen frame

This sample is broken due to language changes.

 
// Keshav 
// Rao                 
import javafx.ui.*;
import javafx.ui.canvas.*;
import javafx.ui.filter.*;
import java.awt.Toolkit;

Frame {
    var s = Toolkit.getDefaultToolkit().getScreenSize()
    title: "Hello"
    undecorated: true
    background: white
    width: s.width
    height: s.height
    content: Canvas {
        content:
        Text {
            var: hello
            x: bind (s.width / 2) - (hello.currentWidth / 2)
            y: bind (s.height / 2) - (hello.currentHeight / 2)
            content: "Hello World!"
            font: Font {face: VERDANA, style: [ITALIC, BOLD], size: 60
            }
        }
    }
    visible: true
}
Rate this article:
Share this article: