Ch. 13
Ch. 16 Files
Miscellaneous
- Lambda.java: sample code using
the Java 8 lambda expressions
- HasCrew.java: illustrates interfaces
- BadVision.java: illustrates using
JavaFX to create a simple form with a button on it. This version does not
use FXML.
- draw1.zip: draw lines on a canvas;
illustrates nesting a BorderPane in a GridPane and a Canvas and HBox inside
the BorderPane.
- Average.java: computing average of
list of numbers
- FileLister.zip: resizeable forms,
using File to classify files and list items in a folder
- multistage.zip: Two stages, one
opening/closing the other. This illustrates setting up stages and
controllers so each has a reference to the other. Key bits to note
in main:
- Create your own instance of FMLLoader for each controller.
- Apply openStream() to the object returned
by getResource. Each call to load creates a new controller.
- Use getController to get the actual controller.