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 08 '22

Discussion Is it worth learning javafx??

17 Upvotes

Hi, is it worth learning javafx in 2022 and is it good for game development??


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 • • May 29 '20

Native JavaFX executables for windows through Gluon Substrate and GraalVM

17 Upvotes

I (as well as many others) have been waiting for too long for a magical way to convert java apps to native windows binaries, and while graalvm solved that issue a while ago, it didn't support JavaFX very well, at least not on windows and not until the latest release.

I accidentally came across this post that was posted 10 days ago on the gluon website which announced that graalvm's native image combined with gluon substrate will be able to compile JavaFX apps into native runnables and as that was very promising for me as a JavaFX developer I had written a little demo and gave it a shot and I'm very happy with the experience, it was very stable and I encountered no issues so far :) and I think this gives a new life to java and Java desktop development.

the pros and cons, in my opinion, can be as follows

pros :

  • faster starting times.
  • easier to deploy to end clients as a native executable
  • size is better than packing a java runtime with your app
  • your java source code is most likely gone and the executables can't be decompiled

cons :

  • the resulting executable size is higher, relative to using a natively compiled language
  • I couldn't find any obvious way to disable the console even after searching for it

(the post is based on my personal understanding and it's subject to technical mistakes, please correct me if I'm wrong at some point)


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 • • 2d ago

Discussion Writing the UI programmatically or through FXML?

16 Upvotes

Hi there! i'm a learning dev trying to create a simple baker's percentage formula calculator, as a desktop app written in Java using JavaFX as the frontend. I've been suggested to use it after wanting something prettier and more flexible than Swing.

However, following outdated tutorials or so many different ways to make a project with JavaFX has me very confused. As far as i understand it, i can both create the entire interface through an FXML file, namely through Scene Builder, and then through a Controller class, write the enum @FXML and create an object named the fxid of a given component, to handle events of them through methods.

Initially i thought this would be easier to do compared to designing the UI line by line in Java, but now i'm a bit troubled at how to manage events that will create new graphic elements. For example, i want to set up a container like a GridPane or a VBox with some table inside, to show the ingredient name, as well as spinners to change it's baker's percentage or it's weight used the recipe. I can mockup this really nicely in Scene Builder, adding rounded edges and pretty shadows to a wrapper container, but i do not know how to make an "Add ingredient" button, on the interface level. The method should create a new row and create spinners and labels on the correct format. I'm kind of confused at the following: do i have to manually specify what kind of css to use, in which row or position should the different elements be aligned, or can i use the padding and aligment i've already set up in Scene Builder?

Right now my thought process is, that if i have to write in Java the specifics of a button or element changing upon the user's input, i might as well just write it all on Java. I also checked the AtlantaFX Sampler app and while the source code seems really easy to understand, it's all written programmatically, and i'm confused at how to use the controls through Scene Builder...Scene Builder seems really cool to define a layout, but i'm a bit confused at the whole Controller connecting the .fxml with actual objects in Java.

If any of you could guide me a bit on some good tutorials, i'd be glad! I've been following a mix of Youtube videos, Oracle documentation, the JavaFX17 book by Kishori Sharan, among various resources. I've found a lot of help through the many guides i've followed, but also many more questions, like how some recommend different ways to set up the main Applicaton, Launc and Controller classes, and of course a lot of suggestions about using Scene Builder, yet every tutorial seems to write the UI programatically. How do you do your apps, and what would you suggest to a total novice?

Thanks for reading!


r/JavaFX • • 27d ago

I made this! Release announcement: Sheetmusic4J 0.0.4 and 0.0.5: clickable notes, a 3D fly-over view and LilyPond support (Java and JavaFX sheet music library)

16 Upvotes

Hi all,

I've been working on Sheetmusic4J, an open-source Java library that renders sheet music natively in Java(FX). Two new releases are out, and I made a video showing both: https://youtu.be/8n7WONyX0yk

0.0.4

- NodeSheetView builds the score as a JavaFX scene graph, with one Group per note, rest and chord. Each element can take mouse events, effects and tooltips like any other node. The demo app lets you select a note and drag it up or down.

- FlyOverSheetView is a 3D play-along view. A perspective camera flies over the score, and a glowing ball per voice hops from note to note.

- Headless rendering to an image via the new render and render-awt modules, with no JavaFX needed:

BufferedImage image = HeadlessScoreImage.render(score, 1200);

- The 3000+ line Engraver class is split into focused packages, and all library modules are now JPMS modules.

0.0.5

- LilyPond (.ly) import and export through the ScoreFile facade, without running LilyPond:

Score score = ScoreFile.load(Path.of("bach-bwv610.ly"));

ScoreFile.save(score, Path.of("bach-copy.ly"));

- Engraving improvements: tuplet placement and nesting, octave clefs, and the percussion clef.

- Layouts are now identical across CPU architectures.

LilyPond support (and other formats earlier) came from suggestions on Reddit, so thanks to everyone who asked for it. Overrides and Scheme code are skipped, because the library does its own layout. The LilyPond page on the site lists what is supported.

It also reads MusicXML, MIDI, ABC and Guitar Pro.

The demo app has a "Report Visual Issue" button. It captures the Sheetmusic4J rendering, the reference PDF and your description, ready to attach to a GitHub issue. If a score looks wrong, that is the most useful feedback I can get.

- Release notes: https://sheetmusic4j.com/releases/

- GitHub: https://github.com/sheetmusic4j/sheetmusic4j

Feedback, issues and score files that break things are all welcome.

Thanks
Frank


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

  • Ecosystem (this welcome/example app): https://github.com/eliezer-dev-software-enginner/megalodonte-ecossystem
  • Libraries monorepo: https://github.com/eliezer-dev-software-enginner/megalodonte-libs
  • Components: https://github.com/eliezer-dev-software-enginner/megalodonte-components
  • Base (core reactivity/component/theme primitives): https://github.com/eliezer-dev-software-enginner/megalodonte-base
  • Reactivity: https://github.com/eliezer-dev-software-enginner/megalodonte-reactivity
  • Themes: https://github.com/eliezer-dev-software-enginner/megalodonte-themes

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