Tutorial 22

Step-by-step Java tutorials from real experiments — covering JavaFX UI development, Raspberry Pi hardware interaction with Pi4J, Java tooling, JVM configuration, and getting started guides for new and experienced developers alike. All examples are practical, tested, and built around things that actually needed solving.

Apr 9, 2025 · 4 min

Defining the Text in a JavaFX ComboBox with Objects

Do you know the problem that you have done a specific task already many times in the past, but it’s too long ago to remember exactly how you did it the previous times? One of …

#javafx#tutorial
Oct 2, 2024 · 3 min

Template project to build a JavaFX application as a JAR with dependencies with Maven

Recently, I was asked what the best way is to build a Fat JAR (a JAR with all dependencies) using Maven. Therefore, I created a GitHub project javafx-jar-template that you can use …

#javafx#tutorial#maven#intellij-idea
Sep 25, 2024 · 3 min

Deep dive into bits, bytes, shorts, ints, longs, signed, and unsigned with Java

On the Pi4J discussion list, someone recently asked what the best and easiest way is in Java to convert a byte value . In Java, there is no distinction between signed and unsigned …

#java#tutorial
Sep 20, 2024 · 3 min

JavaFX with Kotlin versus Java

Recently I have been experimenting with the combination of JavaFX and Kotlin. As Kotlin also runs on the Java Virtual Machine (JVM) and is a very close sister of Java, the switch …

#javafx#kotlin#tutorial
Mar 28, 2024 · 7 min

Example Java Application with Embedded Jetty and a htmx Website

I was experimenting with a Java application that can act as a web server and includes the user interface HTML-files that get modified with htmx, to replace certain parts of the …

#java#htmx#tutorial
Mar 18, 2024 · 8 min

Search in Documentation with a JavaFX ChatGPT-like LangChain4j Application

At the Fosdem conference in Brussels on February 3rd, I gave a presentation about using an existing documentation set as the data for a ChatGPT-like application, created with …

#javafx#azul#artificial-intelligence#conference
Oct 13, 2023 · 8 min

Controlling LED strips with Java

One of the most “fancy” electronic components is definitely a LED strip. It’s really cool to control a long strip of lights with only a few lines of code… But, …

#javafx#pi4j#raspberry-pi#javaonraspberrypi
Jul 26, 2023 · 6 min

Reading the temperature, humidity, and pressure from a BME280 Sensor with Java, Pi4J, I2C, SPI, and JBang

To make it as easy as possible to get started with Java on the Raspberry Pi to interact with electronic components, I started a new section on the Pi4J website with JBang examples …

#java#pi4j#javaonraspberrypi#jbang
Apr 4, 2023 · 3 min

Using the Raspberry Pi Autofocus Camera Module 3 as HDMI camera

More than two years ago, I blogged about the use of the Raspberry Pi as an HDMI camera for the ATEM Mini . Although I have been using such a camera since then as my main Zoom …

#video#raspberry-pi#atem-mini#electronics
Mar 22, 2023 · 8 min

Hidden Beauties of Java Enums

Let’s take a look at the power and beauty of what Java Enums can provide…

#java#jbang#tutorial
Jan 9, 2023 · 2 min

New Section Added to Foojay.io: Java Quick Start

Foojay.io aims to be the starting point for “all-things OpenJDK,” but during one of my morning walks the idea struck me that this site really needs complete beginner materials, …

#java#tutorial#foojay#tutorial
Dec 7, 2022 · 7 min

HiveMQ Cloud, part 4 - Sending sensor data from Raspberry Pi Pico W to HiveMQ Cloud

Exactly one year ago, in December 2021, I published three articles of MQTT messaging with Raspberry Pi, Raspberry Pi Pico and HiveMQ Cloud . On June 30th of 2022, Raspberry Pi …

#java#raspberry-pi#mosquitto#hivemq
May 30, 2022 · 5 min

Create Music Bingo cards with iText

It has been a while since I last had to create documents in a program, and iText has been “on my radar” to try out for a while now. This weekend we had a party and …

#java#tutorial
Feb 7, 2022 · 4 min

Installing Java with SDKMAN on Raspberry Pi

If you create a new SD card for a Raspberry Pi with the operating system, you can choose the “Raspberry Pi OS Full (32-bit)” edition, which includes Java 11. But a lot …

#java#raspberry-pi#sdkman#tutorial
Dec 20, 2021 · 8 min

Using a Raspberry Pi as HDMI camera

TL;DR; Yes, you can build your own Raspberry Pi HQ camera to use as an HDMI source for the ATEM Mini Looking for an affordable camera with HDMI output? Build one yourself with a …

#video#raspberry-pi#atem-mini#electronics
Dec 16, 2021 · 9 min

HiveMQ Cloud, part 3 - Sending sensor data from Raspberry Pi Pico to HiveMQ Cloud

In the previous two posts in this series, we used Java on the Raspberry Pi mini-computer to send sensor data to HiveMQ Cloud, and visualize it on a dashboard.

#java#raspberry-pi#mosquitto#hivemq
Dec 13, 2021 · 8 min

HiveMQ Cloud, part 2 - Using MQTT and Raspberry Pi to Visualize Sensor Data on a TilesFX Dashboard

In the previous post we started our discovery of HiveMQ Cloud with Java on the Raspberry Pi. We created an application to send measurements of various sensors to the HiveMQ Cloud …

#java#raspberry-pi#mosquitto#hivemq
Dec 10, 2021 · 14 min

HiveMQ Cloud, part 1 - MQTT on Raspberry Pi, Send Sensor Data to HiveMQ Cloud with Java and Pi4J

A few years ago I did my first experiments with an MQTT server (Mosquitto) running on a Raspberry Pi to connect an Arduino and Raspberry Pi for the drumbooth of my son . The full …

#java#raspberry-pi#pi4j#mosquitto
Apr 23, 2021 · 6 min

JavaFX running in kiosk mode on the Raspberry Pi

The Raspberry Pi in combination with an inexpensive touch screen, makes a perfect controller for a machine or game console. Let’s see how we can use Java and JavaFX to build …

#javafx#raspberry-pi#gluon#tutorial
Jan 11, 2021 · 8 min

Device monitoring tool with JavaFX, FXGL and Mosquitto

In a previous post “Getting Started with FXGL Game Development” we already have taken a look at the FXGL game development framework developed by Almas Baimagambetov .

#javafx#fxgl#raspberry-pi#mosquitto