Blog of Frank Delporte, Java Champion, Software Developer, Technical Writer, Nerd/Geek

A JavaFX Game Application in a Single Java File with JBang and FXGL

FXGL is a framework to easily create JavaFX-based game applications. In this blog post, I want to show you how this can be done within a single Java-file which doesn’t need a full Maven or Gradle project but can be executed directly with JBang without compilation. This approach can be used as an easy way to get new Java(FX) developers started or create your first experiments with FXGL.

Book review - Modern frontends with htmx

People who follow me, probably know I have a big love for user interface development with JavaFX (for desktop), and Vaadin (for browser). But as always, there are different solutions for every challenge, and building a web user interface with Java can be done with other frameworks. htmx seems to be one of those hot new rising stars, and I already wanted to dive deeper into it, but didn’t find the time yet. Luckily, Wim Deblauwe is here now to help me!

Unexpected Things That Make You a Senior Developer

This post was originally written together with Marit van Dijk and published on foojay.io — a place for friends of OpenJDK.

It’s a Friday, late in the afternoon. To end your work week in a clean way, you decide to get rid of some test data and files from your PC. You hit the enter button to drop a table from your local test database. Within a split second, you realize your error. Your body turns hot and cold at the same time. You double-check, but you already know the truth. You were connected to the production database and just deleted the table with all the customers…

Running a CRaC Java application on Raspberry Pi - UPDATE

On July 15th of 2023, I published a post here about my initial experiments with CRaC on the Raspberry Pi. At that time, I found out that both the Linux kernel in Raspberry Pi OS and the Zulu Build of OpenJDK still needed some changes to work on the Raspberry Pi. I created a ticket in the Linux kernel project, which was solved by Phil Elwell. Last week, a new version of the Raspberry Pi OS, based on Debian Bookworm, was released. And in september, version 21 of OpenJDK was released and the Zulu Build of it, includes CRaC. So let’s see if we can use CRaC without issues, if we bring all this togheter.

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, there is a problem. The timing of the signals is crucial to reliably control these strips. Both Python and Java on a Raspberry Pi can struggle with these timings as they are running on Linux, a non-real-time operating system. So, for instance, pauses in the garbage collection of the Java virtual machine, or any glitch in the operating system can cause unexpected effects on the LED strips. That’s why in most projects, a microcontroller (Arduino, Raspberry Pi Pico, ESP32,…) is used to drive the LED strip. In my search for a good solution to use LED strips with Java, I stumbled on the Pixelblaze Output Expander. This small device is controlled through a serial interface, and handles the control of the LED strip. As it turns out, this is a perfect solution to offload the timing-critical operations from the Raspberry Pi and have reliable output on a LED strip.

Java 21 - JEP 445 - Unnamed Classes and Instance Main Methods

Java 21, released on September 19th, 2023, brings many new features, 8 which are fully integrated and 7 which are incubator or preview. In this post I want to highlight one of those preview features: Java Enhancement Proposal (JEP) 445: “Unnamed Classes and Instance Main Methods”. It’s a preview feature, meaning you need extra flags to use it. The goal of this JEP 445 is to make it easier to get started with Java, as it’s all about reducing the number of keywords when you write, for instance, your very first HelloWorld Java code. It’s ideal for students or anyone who wants to start experimenting with Java. It may also help make Java more popular in boot camps, where JavaScript and Python dominate now.

Page 5 of 19