Java Reference
In-Depth Information
}
}
public static void main(String[] args){
launch(args);
}
}
The constructed application looks like Figure 2-5 .
Figure 2-5 . A simple application using the Print API
In this application, the TextArea component is sent to the operating system's de-
fault printer when you press the Print button.
How It Works
In releases of JavaFX prior to JavaFX 8, there was no standard API for printing por-
tions of an application stage. In JavaFX 8, a Print API has been added to standardize
the way in which printing features are handled. The API also makes it easy to enable
applications with printing functionality using very little code. The API is quite large, as
it contains a number of classes, but it is very straightforward and easy to use.
 
 
Search WWH ::




Custom Search