Scientific Programming II

Programming in Java

Graphics using JavaFX


Disclaimer

While I am good, I am not that good. Many of the example programs are from JavaFX For Dummies by Doug Lowe.


JavaFX is the latest iteration of a graphics API for Java. The first, AWT or Abstract Window Toolkit, was Java's first foray into GUI development, allowing the creation of windowed applications across platforms. However, cross-platform compatibility was ensured with a standard set of GUI elements that looked identical across platforms. Consistent, but ugly. Several years passed, and Swing was introduced. Swing was also an attempt at cross-platform GUI elements, but unlike AWT used native GUI elements. Applications built with Swing looked native, whether running on Windows, OS X, or a flavor of Linux.

We, however, are in the future. Applications exists still for traditional computers, but we live in a world of tablets, smartphones, smart TVs, game consoles, and even tweeting refrigerators. JavaFX was developed as a library to provide a standard GUI API across all of these devices, and more to come in the future. Beginning with Java 8, JavaFX comes standard with the JDK.

This will be a fairly lengthy unit. JavaFX is a very large library, and while we will be spending some time on it we will only begin to scratch the surface.

So, without further ado, let's begin!


Introduction


Events


Stages and Scenes


Layout Panes


User Input


Media


JavaFX Project


FileChooser