JavaFX 8 Hello World for Eclipse

Learning JavaFX 8 on Eclipse is simple, once you get past the first Hello World style example. This JavaFX tutorial introduces SceneBuilder, FXML, and JavaFX 8 for Eclipse with an event (an ActionListener) and a controller class.

Believe it or not, I have a JavaFX 8 book that never once explains how to hook up events between a POJO and FXML generated from SceneBuilder—hundreds of pages of how-to material on JavaFX, and not one word on events. Pretty sad.

No such letdown here.

This tutorial demonstrates and explains creating a window that displays a button and a textfield in JavaFX 8, and then hooking them up in Eclipse, using SceneBuilder, so that clicking the button results in the words “Hello World” displaying in the textfield.

Continue reading “JavaFX 8 Hello World for Eclipse”

JavaFX … Information Alerts: Hello World

For decades, the traditional first program created when learning a computer programming language has been the “Hello World!” program. I like the tradition, so we’ll do the same here.

All Hello World does, is print out “Hello World!” As it turns out, there are lots of ways to do this in Java. They vary as widely as printing to a web page, or using a Swing dialog to pop up the words.

The two most cutting edge ways to do new Java apps are with GWT and JavaFX. GWT is too difficult for first time programmers, so I’ll stick to using the friendlier JavaFX for this tutorial.

This is part of the Java Tutorial series I’m writing for my son.

Continue reading “JavaFX … Information Alerts: Hello World”