-
Book Overview & Buying
-
Table Of Contents
JavaFX 1.2 Application Development Cookbook
By :
Practitioners of JavaFX can easily abuse its ease of use to create applications that perform and scale poorly. This section provides a list of some practices that should help you avoid performance or usability penalties.
Declare your variables using the def keyword always use the def keyword to declare your variable, unless you know for certain that the variable will be updated later or is a bound variable.
Stay off the EDT JavaFX applications are inherently single-threaded running on one special thread called the Event Dispatch Thread (EDT). All GUI activities are handled on the EDT. If you execute long-running processes directly in your JavaFX code, they will degrade the responsiveness of the UI or make it outright unusable. JavaFX offers the Task API, which is designed to provide the mechanism to execute processes asynchronously.
You can do this in three steps:
1. Create a Java class that implements javafx.async.RunnableFuture and...
Change the font size
Change margin width
Change background colour