-
Book Overview & Buying
-
Table Of Contents
JavaFX 1.2 Application Development Cookbook
By :
A popular way of running media-rich applications is the use of the full-screen theater mode. This is a great way to grab the user's attention by hiding all other applications and place the focus on your application's content. This recipe shows you how to accomplish the same effect by running your application in full-screen mode.
There is not much in prerequisite for this recipe. You do, however, need to know how to create a basic JavaFX application and know how to add content to the stage. To refresh your memory, see Building a JavaFX application.
To go full-screen, you simply set the Boolean value of the fullScreen property on the Stage object to true as shown in the partial listing given next. You can see the full code listing for this recipe at ch02/source-code/src/application/FullScreen.fx.
Stage {
title : "Going Full Screen"
width: 300
height: 200
fullScreen:true
scene: Scene {
content: [
Rectangle {
x: 100 y: 50
width: 100 height: 100...
Change the font size
Change margin width
Change background colour