r/JavaFX • • Jun 15 '23

I made this! Fx Calculator: A calculator for Android written in JavaFX (and Scala)

17 Upvotes

Here's the 1.0.0 version of FxCalculator

It's, well, a calculator for your Android phone.

It's got all the usual buttons with numbers and operators, and also parentheses as well as buttons for storing the partial results of your calculations to the memory.

But that's not all. It also has an advanced editor hidden under the "Fx" button. In that mode, you can write an expression with your virtual keyboard, as if you were writing simple programming code. You can use variables and functions from a list, combine them, and even write your own custom ones. They will be stored on the phone so they can be actually useful to you more than once.

And, on top of that, FxCalculator was written in Scala 3, with JavaFX, Gluon, and GraalVM Native Image. For now it's available only as APK stored on GitHub. You can install it by allowing 3rd party APK installation on your Android, clicking the link above on your phone, and then downloading and installing the APK from there.

I will try to push the app to the Google store and create a better looking webpage for it later this year.


r/JavaFX • • Jan 07 '22

Moderator Taking on new moderators and wiki contributors

17 Upvotes

For context the last mod post is here: State of the sub: New moderation

In that post I outlined some plans, of which would require new moderators and community contributions. So to keep things brief I'm looking for two distinct roles:

Janitors

Moderation really is just being an internet janitor most of the time. When somebody poops out some crappy spam link somebody needs to clean it up. Reddit makes the job quite easy. When somebody reports a post you can see them next to the comments URL. Validate that the reports are valid or not and take the appropriate actions. Same thing applies to comments.

Sometimes posts slip by and go unreported, but this is a low traffic sub so glancing at the page and checking new post comments sections takes only a minute.

The other thing is adding relevant flair to unflaired posts. This makes it so that users can sort posts by flair and see every post of that kind. Most people remember to add flair so this is also easy work.

Since this is an easy task and takes only a little time, I think 1-3 people makes sense.

Wiki contributors

This is really the one I think is more valuable. I feel like I see similar questions being asked at a regular enough interval where we can maintain a sort of FAQ section. This is currently shown in the Common Problems wiki page.

But the wiki can be more than that. For example a great resource on how to start working with Java in general is dev.java/learn. Having a similar layout but dedicated solely to JavaFX would be excellent.

I'm looking for:

  • Ideas on what sections to include and layout plans. The wiki should be easy for new users to find what they're looking for without too much hassle.

  • Ideas on how to make the wiki more of an obvious resource for users of the subreddit. For example being able to easily refer users to relevant wiki pages if they have questions answered by the wiki.

  • People willing to contribute to the wiki on areas they are knowledgeable in or at least being able to cite high quality 3rd party content

Due to the nature of this role, I see no reason to have an artificial cap on the number of wiki contributors. The only reason the wiki is locked behind permissions anyways is to make it less of a free-for-all.


How to apply:

Comment or DM containing information about:

  • What role(s) you are looking to go for

  • Reasoning for why you would be good for the role

I'm probably going to keep this open for a month or so that more people have the opportunity to apply / check out the post.


r/JavaFX • • Jun 06 '21

I made this! I wrote a library to play Flutter-inspired implicit animations, without any pollution to your code!

Thumbnail
github.com
17 Upvotes

r/JavaFX • • Feb 23 '21

WebFX - run JavaFX on browser (even offline)

17 Upvotes

We have surely heard of JPro, something which makes our JavaFX run on the browser. Now there is a new addition to this almost ready for us to use. JPro works using websockets and your actual code runs on the server, the browser is only used to render. However WebFX is different. It compiles all your java code to js and runs it inside the browser natively as an obedient well behaved javascript.

Check our the SpaceFX (the famous game by Hans Solo) running in your browser using WebFX : https://spacefx.webfx.dev

Here is the page of the WebFX github project.

github.com/webfx-project/webfx/

The developer expects to release it surely before the end of this year. That sounds like a long period, but for me I can wait.

If you like the project, please give it a star on github, and drop your feedback and supportive appreciation here : https://github.com/webfx-project/webfx/discussions/4


r/JavaFX • • Jan 09 '21

I made this! JavaFX custom TreeView

17 Upvotes

Some days ago I decided to reinvent the wheel and make my own custom implementation of a TreeView.

Why? Because I think the JavaFX system is overcomplicated, I have a lot of spare time, I'm always willing to learn new things, plus my tree is animated 😎

Here is a preview of what I have achieved so far, it's not much, but it's honest work.


r/JavaFX • • Jul 29 '20

I made this! JavaFX 3D - Procedural world generation (P_1)

Thumbnail
youtube.com
17 Upvotes

r/JavaFX • • Dec 07 '19

Generic (Java FX) Graph Visualization Library

Thumbnail
github.com
17 Upvotes

r/JavaFX • • Dec 23 '16

Understanding JavaFX Event Types - Java Programming Forum

Thumbnail java-forums.org
17 Upvotes

r/JavaFX • • Aug 01 '26

Tutorial Learning reactive UI with State: derived state from user input, a string length app

16 Upvotes

Third post in the series. This one moves from State alone to ComputedState β€” showing how to derive a value from another reactive value and have it stay in sync automatically as the user types.

The setup: textState holds whatever the user types into the Input. textLenghtComputed is a ComputedState<String> built with ComputedState.of(...), watching textState as a dependency. Every keystroke updates textState, which recomputes textLenghtComputed, which updates the Text on screen β€” no listeners wired up by hand, no manual recompute calls.

package my_app;

import megalodonte.ListenerManager;
import megalodonte.application.MegalodonteApp;
import megalodonte.base.theme.ThemeManager;
import megalodonte.theme.DefaultTheme;

public class Main {

    static void main() {
        ThemeManager.setTheme(new DefaultTheme());

        MegalodonteApp.run(context -> context.useView(new HomeScreen()), ev->{
            if(ev == MegalodonteApp.Event.CloseRequest){
                System.out.println("Clicked on X - close application");
                ListenerManager.disposeAll();
            }
        });
    }
}


package my_app;

import megalodonte.ComputedState;
import megalodonte.base.components.Component;
import megalodonte.base.components.ScreenComponent;
import megalodonte.base.state.State;
import megalodonte.components.Text;
import megalodonte.components.inputs.Input;
import megalodonte.components.layout_components.Container;
import megalodonte.props.ContainerProps;

public class HomeScreen implements ScreenComponent {
    State<String> textState = new State<>("");
    ComputedState<String> textLenghtComputed = ComputedState.of(
            ()-> "Size is: " + textState.get().length(), textState
    );

    u/Override
    public Component render() {
       return new Container(new ContainerProps().paddingAll(20)).children(
               new Input(textState),
               new Text(textLenghtComputed)
       );
    }
}
  • ComputedState.of(supplier, dependencies...) recomputes automatically whenever any listed dependency changes β€” no manual subscribe/notify needed.

  • Input(textState) binds the text field directly to a State<String>, so typing writes straight into reactive state.

  • Unlike the counter's counter.map(...), this shows ComputedState built from a lambda with an explicit dependency list β€” useful once a derived value needs to read from more than one state.

If you're finding this series useful, dropping a star on the repos below genuinely helps the project get visibility β€” takes two seconds and means a lot for a solo-dev framework like this.

Repos


r/JavaFX • • Jul 28 '26

I made this! Megalodonte β€” a small reactive UI framework on top of JavaFX

16 Upvotes

I've been building JavaFX desktop apps for a while and got tired of the usual boilerplate (manual listeners, imperative styling, no real component model), so I built Megalodonte: a thin reactive layer on top of JavaFX β€” React-ish component composition, State<T>/ComputedState<T> for reactivity, and a Props/Theme system so styling isn't scattered setStyle() calls everywhere.

It's still early and I'm the only user so far, but it's real, working code β€” not a toy. Posting it here mostly for feedback and to see if this is useful to anyone else stuck with JavaFX.

What "Hello World" looks like

Main.java β€” bootstraps the app and sets a theme once, up front:

package my_app;

import megalodonte.ListenerManager;
import megalodonte.application.MegalodonteApp;
import megalodonte.base.theme.ThemeManager;
import megalodonte.theme.DefaultTheme;

public class Main {

    static void main() {
        ThemeManager.setTheme(new DefaultTheme());

        MegalodonteApp.run(context -> context.useView(new WelcomeScreen()), ev -> {
            if (ev == MegalodonteApp.Event.CloseRequest) {
                System.out.println("Clicked on X - close application");
                ListenerManager.disposeAll();
            }
        });
    }
}

WelcomeScreen.java β€” the actual UI, as a composable screen component:

package my_app;

import megalodonte.base.components.Component;
import megalodonte.base.components.ScreenComponent;
import megalodonte.components.Text;
import megalodonte.components.layout_components.Container;
import megalodonte.props.TextProps;

public class WelcomeScreen implements ScreenComponent {
    @Override
    public Component render() {
        return new Container().children(
                new Text("Hello world", new TextProps().fontSize(90))
        );
    }
}

What's in it

  • Reactive state β€” State<T>, ComputedState<T>, ListState<T> β€” components subscribe and re-render on change, no manual wiring.

  • Component model β€” screens are ScreenComponents with a render() you compose out of Container/Column/Row/Text/Button/etc., instead of hand-building a Scene graph.

  • Props + Theme system β€” styling goes through typed Props classes (TextProps, ContainerProps, ...) resolved against a ThemeInterface, instead of ad-hoc inline CSS strings.

  • Router β€” navigation between screens without manually juggling Scene.setRoot(...).

  • Used it to build a full JavaFX ERP desktop app, so it's exercised well beyond "hello world".

Repos

Happy to answer questions β€” and honest criticism is welcome, this is very much a work in progress.


r/JavaFX • • May 14 '26

I made this! fx2048 - Play 2048 offline on desktop (Java-based)

Thumbnail
brunoborges.github.io
16 Upvotes

r/JavaFX • • Apr 11 '26

Release My fork of TestFX just got a new release. Now it's a bit easier to use it in your build.

Thumbnail
gitlab.com
16 Upvotes

r/JavaFX • • Feb 08 '26

Discussion Why should someone still use javafx in 2026 ?

16 Upvotes

Hello people, hope you are doing well. I am woundering why someone in 2026 should use javafx ? there are lot's of desktop GUI framework (electron js, compose multiplatform, flutter) that are enriched with developer experience. Still I see lots of people here use javafx for developing new applications.

My question is, what is the speciality ? I've developed some desktop client with both javafx and compose. Each time I found javafx more complex and difficult to work with.


r/JavaFX • • Aug 06 '25

Tutorial Creating an MSI is easy with this tutorial with JavaFX

16 Upvotes

I found this video tutorial on YouTube I really recommend guys trust me, it's so easy and the instructor uses vscode too.

This video you help you:

https://youtu.be/HJPHG8Bqq98


r/JavaFX • • Aug 03 '25

Tutorial JavaFX Packaging with the Mill Build Tool

16 Upvotes

As there are many questions about packaging lately here I want to make a quick tutorial on how to package a JavaFX app with mill.

IMPORTANT: this is for a non-modular JavaFX application, i.e. java development in the "traditional" sense. I am confident that a modular project can be built easily with some modifications. The advantage is that we can use any library there is, even "auto-module" ones.

Short preface

I have been following the development of the mill build tool by true 10x engineer u/lihaoyi . It's absolutely impressive work and it fixes a lot of issues I had with other build tools. The only downside could be the usage of Scala, which is why this amazing tool is getting heat in the java subreddit. However, I am amazed by the people happily accepting arcane and undiscoverable Groovy in their gradle build files and yet dismiss navigatable, typed and documented Scala code as build definition.

I urge you to give mill a try, it is in stable 1.0.0. https://mill-build.org/mill/index.html

Project structure

/
β”œβ”€β”€ mill
β”œβ”€β”€ build.mill
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ app
β”‚   β”‚   └── App.java
β”‚   β”‚   └── AppLauncher.java

short explanation of the files:

note, that is possible to have the maven style src/main/java and src/main/resources structure, I will get to that later. I will stick to mill standards for now.

the app does not much, for the sake of completeness here is the code:

package app;


import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class App extends Application {
    
    public static void run(String[] args) {
        launch(args);
    }

    
    public void start(Stage primaryStage) {
        primaryStage.setTitle("Hello World!");
        Button btn = new Button();
        btn.setText("Say 'Hello World'");
        btn.setOnAction(event -> System.out.println("Hello World!"));

        StackPane root = new StackPane();
        root.getChildren().add(btn);
        primaryStage.setScene(new Scene(root, 300, 250));
        primaryStage.show();
    }
}

now it gets interesting. behold your entire build file (project root build):

//| mill-version: 1.0.0
package build
import mill.*, javalib.*

object `package` extends JavaModule, JpackageModule {
  
  def jpackageType = "deb"
  def jpackageName = "javafx-app"

  val javaFXVersion = "21"
  val javaFXModules = List("base", "controls", "graphics").map(m => mvn"org.openjfx:javafx-$m:$javaFXVersion")

  def mvnDeps = javaFXModules

}

I am on linux and prefer deb packaging, ymmv. The dependencies can be listed explicitly, for terseness I build a list by mapping.

We are done. Open the project (folder) in IDEA and the BSP server will configure the project.

Run and Build

You can run the app by executing ./mill.run in the terminal or by running the AppLauncher class in IDEA.

If everything is fine - Lets try building a fat jar:

./mill assembly

Done. Let's show the output:

./mill show assembly

this will show "ref:v0:11d0bc62:<project-path>/out/assembly.dest/out.jar".

Cool lets run it:

java -jar out/assembly.dest/out.jar

Everything should work. No shading or uberjar plugin needed. This is mill out of the box.

Packaging with JPackage

now it gets interesting. our build definition already extends JpackageModule, so we can use the jpackageAppImage command to build a package.

./mill jpackageAppImage

Let's show the output:

./mill show jpackageAppImage

Alright, we have "ref:v0:13953976:<project-path>/out/jpackageAppImage.dest/image". This is where my deb package is located.

It's installable on my system and installs itself into /opt/javafx-app. You can run it with javafx-app command.

Notes

The build file is plain scala. You can navigate code e.g. JpackageModule and see what it does. You can override methods and customize the build process. Instead of the JavaModule you can use MavenModule to get the maven style source structure.


r/JavaFX • • May 23 '25

Discussion JavaFX Marketplace - survey

16 Upvotes

Hi everyone! πŸ‘‹

We are surveying the market to see what interest there would be in a marketplace for JavaFX UI components – a platform where developers can download, buy, sell, or share custom JavaFX controls, themes, and UI elements.

We are running a short survey to better understand the real needs of JavaFX developers.

πŸ”— Take the 1-minute survey here
(No email required unless you want to be contacted for early access!)

We are especially interested in:

  • What kinds of components you’re missing

  • Whether you'd use or contribute to such a marketplace

  • How you currently handle UI design in JavaFX

Whether you're a beginner or a seasoned Java dev, your input would be incredibly valuable πŸ™

Thanks in advance, and feel free to comment your thoughts or ideas!


r/JavaFX • • May 10 '25

JavaFX in the wild! JavaFX 24 and Beyond

Thumbnail
youtube.com
16 Upvotes

r/JavaFX • • Jan 12 '25

I made this! Ikonli Icon Browser

16 Upvotes

I created this app because I use Ikonli a lot. There are tons of icons, and at this time, they do not have a complete icon browser. Their browser is in the works.

My browser will allow users to search all icons, search icons by provider, browse all icons, or browse icons by provider.

Improvements I would like to see in the future:

  1. A splash screen. It takes the app a while to load all of the icons.

  2. A better UI look. If anyone is good at UI's, let me know.

Link to repo -> https://github.com/sedj601/IkonliIconBrowser

Try it! If you find bugs or want to see improvements, let me know.


r/JavaFX • • Nov 02 '24

Cool Project Cognitive - A JavaFX MVVM forms library

Thumbnail
github.com
16 Upvotes

r/JavaFX • • Oct 09 '24

Tutorial New Article: Beginners' Guide to Properties

16 Upvotes

I realized after finishing all of the deep dive articles on the Observable classes and interfaces that I have never written a beginners' overview of how all of this stuff works. So I started this article out more from a desire for closure more than anything else. But it got away from me, and turned out to be pretty big.

I'm a "first principles" learner myself, so that's the way that I try to lay these concepts out when explaining it to others. I feel that if you understand a bit about the "why?" and the "how?" of how this stuff is architected, then you'll be in a position to make informed decisions about how to use it in real life.

This article focuses on how to use Properties to create Reactive GUI applications, because I really feel that this is the way that JavaFX is intended to be used.

In this article I try to answer the questions like, "What are these property things?", "Why would I want to use them?", and "Which classes should I use in various circumstances?". There's an overview of the most common types, a look at Listeners and Subscriptions, and section on Bindings. Finally, there's a small example program where I try to show Properties, Bindings and Subscriptions working together to create a Reactive application.

The article is here: https://www.pragmaticcoding.ca/javafx/elements/beginners-properties


r/JavaFX • • Jun 24 '24

I made this! Basic hex editor, virtualized and keyboard navigable

16 Upvotes

r/JavaFX • • Jan 30 '24

I made this! Observing the system color scheme in JavaFX 22

Thumbnail
twitter.com
16 Upvotes

r/JavaFX • • Sep 09 '23

I made this! Made an Image Translator with JavaFX and B4J

Thumbnail
youtube.com
16 Upvotes

r/JavaFX • • Aug 14 '23

Discussion Is JavaFX a good choice for a new cross platform app?

16 Upvotes

Hi. I have zero knowledge in Java and JavaFX but good knowledge in C#, VB, PHP, JS, GO, and some others. So I have no worries to learn the Java language. I consider writing a new app for end users that should target all relevant platforms (Windows, MacOS, Linux, Android and iOS). Of course, I try to prevent writing and maintaining the same app multiple times for all the platforms. There is no problem in having some platform specific extras and compiler switches. But the most code and GUI layout should be used in common.

I also consider

  • .NET MAUI

  • QT & C++

  • Flutter

  • WebUI & golang

On Wikipedia, especially on the German Wikipedia site (roadmap), the future of JavaFX is seen critical and not secured for beyond 2025. Is that real?

Also, I wonder if WebView and other widgets are available on all platforms? I found no table to give some overview about widgets and platform availability. For example, I plan to use the WebView widget to create a "WYSIWYG editor" for users to allow writing HTML messages (I do so in the current version for Desktops by using ckeditor.js in a sort of WebView).

I also need to use and call a third party library (dll / so / .a written in C) for several tasks. Is that possible in JavaFX on all mentioned platforms if the library is available?

I general, is JavaFX able to provide an app through all platforms? And is it a good idea to start a new app with my needs in JavaFX nowadays?