JUG Leader, Java Champion, Speaker, Author, ❤️ Java(FX) and coding in general
Hello and welcome to Part 4 of a series of blog entries on how I created a “sci-fi” looking world clock using JavaFX. If you are new to this series you can visit Part 1, 2, & 3.
If you’ve been following me to this point take a moment to stand up, breath, take a bow and then pat yourself on the back. You are more than half way through the series.
In Part 4 I will be fast forwarding my progress of the JFX World Clock and jump right into how to build and create an installer that you can distribute. I will be using a new Java build tool called Bach by Christian Stein @sormuras. Later on, I will also show you my original build approach using the Maven build tool.
Do you ever get bored of the plain old UI Forms? Often, UI forms will have nice visual cues and validation icons as feedback when the user has typed something incorrectly.
In Part 3, I’ll be discussing the UI form section of the JavaFX World Clock that allows the user to add and modify timezone locations. While building Java apps using the new module system can be a bit of a challenge, here I will show you how I was able to successfully build a modern MVC based JavaFX UI!
The JDK Butler is an app that makes use of the Foojay Disco API to enable you to drill down to a JDK of your choice and download it to your machine. As you can see on the screenshot we have columns where we can select things like major version, version, distribution etc.
Every time you select something, the selected text will be colored in a specific color and you will see a small triangle pointing into the direction of the selected item. So, the question is, how did I create this triangle? To explain this, let me show you some screenshots from my vector drawing program to explain what I did.
Drawing on the Canvas node will directly go down to the graphics hardware, which makes it really fast.
Of course, this also comes with drawbacks because all the things that you draw on the Canvas node are part of that one node.
Meaning to say that if you would like to implement something like mouse interaction, you have to implement the whole mouse interaction on your own (tracking the mouse position, calculate if the mouse is inside/outside of objects you draw, keeping track of objects that should interact with the mouse etc.).
Learn how to create a custom control that is based on the JavaFX Region class. The Region class is the class that all JavaFX controls are based on. It is a resizable Parent node which can be styled from CSS.
This is the class that you would want to use when building a JavaFX custom control that is not part of a controls library.
The main difference between the Region and the Control + Skin based approach is the fact that the Region based control contains both, the control logic and the UI where the Control + Skin based control separates the logic from the UI. The logic can be found in the Control and the UI can be found in the Skin.
In this part of the series, I will show you how to create a custom control in JavaFX by using Control and Skin classes.
A custom control created by a Control and Skin class only makes sense if you will provide more than one Skin for your control or if you would like to give people the ability to create their own Skins for your Control.
In any other case, you should choose another approach (e.g., use a Region or Canvas based control).
So, usually, the Control and Skin approach is used in UI libraries where you have one Control with multiple Skins.
If you’ve been following this series of blog posts, you already read about how to create custom controls by re-styling existing controls or combining existing controls.
This time let me show you how to create a custom JavaFX control by extending an existing control.
The goal for today is to create a TextField that looks similar to the TextField that you can find in MaterialDesign.
Last time we saw how to create custom controls in JavaFX by simply playing around with CSS styles for the component.
This time I will show you how to create a custom control by combining existing controls.
The idea is to create a control that contains a text field where you can type in values and besides the text field should be a button that when pressed will convert the value from the text field to another value.
As long as you only would like to create a simple form-based application, the available UI controls in JavaFX will work totally fine.
But when it comes to special requirements, you quickly will run into problems where you need to create your own controls. Unfortunately, in JavaFX, the decision was made to make a lot of the code from the UI controls private and final.
In this part, we will create a custom JavaFX control by changing the style of an existing control.
In this article, we comparatively evaluate four different approaches to render particles in JavaFX in terms of runtime performance.
The approaches are Canvas, PixelBuffer AWT, PixelBuffer CPU and PixelBuffer GPU.
The evaluation suggests the following order of approaches from fastest to slowest:
– PixelBuffer GPU (fastest).
– PixelBuffer CPU.
– PixelBuffer AWT.
– Canvas (slowest).
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.
But, this game engine can also be used for other use cases. In this post, we will be building a system monitoring dashboard, which can run on a Raspberry Pi.
The dashboard can be used to keep an eye on any device that can report its state to a queue. And, for me personally, it finally solves the problem of finding the IP addresses of all my Raspberry Pi’s when my router decided to shuffle them.