FontAwesomeFX 8.0.9 with 40 new icons

I have updated FontAwesomeFX and released version 8.0.9.
A few days ago the FontAwesome 4.2.0 was released with 40 additional icons (FontAwesome now contains 479 icons).

Also I added a simple browser to preview all contained icons.
You can start it via: de.jensd.fx.fontawesome.test.IconOverview


Download Binaries
Sources @ Bitbucket

Maven Artifact:


MQTT.fx 0.0.7 released

A new version of MQTT.fx is available featuring:

  • Scripting support
  • Setup/Re-configuration tool
  • Reviewed Connection Profile Editor
  • Reviewed UI and style


Download latest binaries HERE.

Scripting support

I have added support for scripts executed by the Nashorn Engine.
Thought it might be helpful for testing a MQTT message flow of a certain setup, e.g. simulate sensors sending temperature value messages. All controlled via the UI.


Adding new scripts

New scripts can be easily made available for execution via the UI. The app is scanning a folder named “scripts” located at the MQTT.fx working directory:
OS X: [USER_HOME]/Library/Application Support/MQTT-FX/scripts
Windows: [USER_HOME]\AppData\Local\MQTT-FX\scripts
Linux: [USER_HOME]/MQTT-FX/scripts
If this folder does not exists it is created by MQTT.fx containing a demo script.


Naming convention:


[INDEX] - controls the order of the entry in the drop down menu
__ - delimiter between index and name
[NAME] - the name of the menu entry (words are delimit by '_')

If you name a script “separator”, e.g. 02__separator.js a separator is added to the menu at the “index” position.


Example script:

var Thread = Java.type(“java.lang.Thread”);
var System = Java.type(‘java.lang.System’);

function execute(action) {
out(“Test Script: ” + action.getName());
for (var i = 0; i < 10; i++) { switchON(); Thread.sleep(500); switchOFF(); Thread.sleep(500); } action.setExitCode(0); action.setResultText("done."); out("Test Script: Done"); return action; } function switchON() { out("fountain ON"); mqttManager.publish("home/garden/fountain", "ON"); } function switchOFF() { out("fountain OFF"); mqttManager.publish("home/garden/fountain", "OFF"); } function out(message){ System.out.println(message); } [/javascript] The entry point of execution is the function execute(action).
During script execution System.out is hooked by MQTT.fx to print output to the console. Thus with System.out.println() messaged can be printed to the UI-console.

The interface to the broker-connection is the bound mqttManager. Messages can be published via the established broker connection.

Setup/Re-configuration Tool

If no configuration can be found, the app assumes its first start. The user is promoted with a setup dialog to create e new configuration.

Also if a configuration has been found but it seems to be corrupt or the format doesn’t fit a newer version also a new configuration can be created or the exiting config can be opened in an external editor (assumed an editor has been assigned to open *.xml-files.


Reviewed Connection Profile Editor
Now the Connection Profile Editor is recognising wether the chosen profile has been changed (buttons are enabled/disabled accordingly). Changes can be reverted as not already applied.


Reviewed UI and Style

Greetings from Yosemity! 😉

Poor mans input constraints

For me the best way to prevent the user from annoying errors and error messages is simply in the first line to try not to allow the user e.g. to enter invalid data or to execute actions while data in incomplete (disabled buttons/menu entries).
If only numbers allowed in an input field I think its a better approach to restict user input to numbers only instead of validating and popping up with error messages after applying or “OK”.

Swing has a JFormattedTextField which allows setting a format pattern to verify the input data. Sadly the current JavaFX API doesn’t contain such kind of control but thers is a way by adding an EventHandler for KEY_TYPED-Events and to consume the event at certain conditions. Consuming the event will end up the event bubbling phase. (see Handling JavaFX Events for more informations).
Clearly this can be implemented in a new control or by creating a subclass of TextField. But there is also a simple approach by attaching the wanted constraints to existing instances of standard controls. As you my know the editor controls of Cells and ComboBoxes are also TextFields. Thus such a handler can also be attached e.g. to a ComboBox.

Don’t sue me for this very simple approach ;-)!
As this is just a limitaion of the INPUT while TYPING it can be bypassed e.g. by copy-paste.
Clearly in the long run a JFormattedTextField like control supporting pattern matching, validation and user feedback is needed!

Runnable demo and code can be found here.



public class InputConstraints{

    private InputConstraints() {
        // not needed here

    public static void noLeadingAndTrailingBlanks(final TextField textField) {
        textField.addEventFilter(KeyEvent.KEY_TYPED, createNoLeadingBlanksInputHandler());
        textField.focusedProperty().addListener((Observable observable) -> {

    public static void noLeadingBlanks(final TextField textField) {
        textField.addEventFilter(KeyEvent.KEY_TYPED, createNoLeadingBlanksInputHandler());

    public static void noBlanks(final TextField textField) {
        textField.addEventFilter(KeyEvent.KEY_TYPED, createNoBlanksInputHandler());
        textField.focusedProperty().addListener((Observable observable) -> {

    public static void numbersOnly(final TextField textField) {
        numbersOnly(textField, Integer.MAX_VALUE);

    public static void numbersOnly(final TextField textField, final Integer maxLenth) {
        textField.addEventFilter(KeyEvent.KEY_TYPED, createNumbersOnlyInputHandler(maxLenth));
        textField.focusedProperty().addListener((Observable observable) -> {

    public static void lettersOnly(final TextField textField) {
        lettersOnly(textField, Integer.MAX_VALUE);

    public static void lettersOnly(final TextField textField, final Integer maxLenth) {
        textField.addEventFilter(KeyEvent.KEY_TYPED, createLettersOnlyInputHandler(maxLenth));
        textField.focusedProperty().addListener((Observable observable) -> {

    public static EventHandler<KeyEvent> createNoLeadingBlanksInputHandler() {
        return (KeyEvent event) -> {
            if (event.getSource() instanceof TextField) {
                TextField textField = (TextField) event.getSource();
                if (" ".equals(event.getCharacter()) && textField.getCaretPosition() == 0) {

    public static EventHandler<KeyEvent> createNumbersOnlyInputHandler(final Integer maxLength) {
        return createPatternInputHandler(maxLength, "[0-9.]");

    public static EventHandler<KeyEvent> createLettersOnlyInputHandler(final Integer maxLength) {
        return createPatternInputHandler(maxLength, "[A-Za-z]");

    public static EventHandler<KeyEvent> createNoBlanksInputHandler() {
        return (KeyEvent event) -> {
            if (event.getSource() instanceof TextField) {
                if (" ".equals(event.getCharacter())) {

    public static EventHandler<KeyEvent> createPatternInputHandler(final Integer maxLength, String pattern) {
        return (KeyEvent event) -> {
            if (event.getSource() instanceof TextField) {
                TextField textField = (TextField) event.getSource();
                if (textField.getText().length() >= maxLength || !event.getCharacter().matches(pattern)) {

MQTT.fx 0.0.6 released

I have just released a new version of MQTT.fx (0.0.6).

Download latest binaries HERE.

Introducing Connection Profiles
Instead of choosing a certain broker address and a broker port using the same connection options, I now have implemented Connection Profiles.

A named Connection Profile contains all information for a certain broker connection (address, port, Auth/SSL/TLS settings, Last Will/Testament, etc.). It’s much easier now to connect to different brokers with changed setups and connection options:


Now a connection can be established by just choosing the name of a previous defined profile:


Support for SSL/TLS

Also I have started to implement support for SSL/TLS secured connections.
MQTT.fx - v0.0.6 - connected unsecure
MQTT.fx - v0.0.6 - connected secure

Support for Certificate Files

Support for Keystores
Edit Connection Profiles keytores

Again the configuration-format has changed, v0.0.6 will conflict with former versions and MQTT.fx won’t start.
In this case just delete (or rename) the mqttfx-config.xml.
Windows: [USER_HOME]\AppData\Local\MQTT-FX\mqttfx-config.xml
OS X: [USER_HOME]/Library/Application Support/MQTT-FX/mqttfx-config.xml

The new configration is automatically created on next app start.