/r/JavaFX

Photograph via snooOG

JavaFX is an open source, next generation client application platform for desktop, mobile and embedded systems.

Useful resources (Full list)

Rules

  1. No NSFW/NSFL content
  2. No service requests/offers
  3. Must be JavaFX related
  4. No politics

Related subreddits

Other communities

/r/JavaFX

7,662 Subscribers

1

No connection with je2java.exe

Hi Reddit,

So I have installed Java Editor for school on my laptop. But it does not have a connection to the je2java.exe file. It says: No connection with C:\ProgramFiles\JavaEditor\je2java.exe , but the je2java application is in the right map and location. So what do I need to do to make my JavaFX applications run?

0 Comments
2024/11/01
14:22 UTC

2

Qt/QML Professional Exploring JavaFX/Gluon Mobile Seeking Advice

Hey, everyone, thanks for your input. I work professionally in C++ with Qt (using QML for the GUIs) in both desktop and mobile applications built with Qt 6.8.0 (the newest LTS). I'd like to make a clone of one of the applications using JavaFX, but I know nothing about the audio libraries available for implementing robust panning, adequate reverb, changing pitch, changing tempo, etc.. I'm not an audio programmer, I just happen to work on audio applications, so writing all of that myself with adequate performance is highly unlikely, especially in a timely fashion.

I'm also a little confused about JavaFX's pulse processing and what, exactly, prevents render cycles in JavaFX that won't prevent them in Qt, especially since JavaFX seems to perform similarly to a QML GUI in most cases. I'd love some information from the community that really knows this tool, since I've read a book and built toy applications for Android, iOS, Linux, macOS, and Windows, not anything substantial.

1 Comment
2024/10/31
20:12 UTC

4

How to Use Firebase Authentication in JavaFX for Desktop Applications

Hi everyone,

I’m currently working on a JavaFX desktop application and want to integrate Firebase Authentication to manage user accounts. I chose Firebase because it's easy to use and will also help me transition to developing a native Android app in the future.

However, I'm feeling a bit lost on how to implement Firebase Authentication in my JavaFX app. Here are a few questions I have:

  1. Setup: What are the necessary steps to set up Firebase Authentication in a JavaFX project?
  2. Code Examples: Are there any code snippets or examples that show how to authenticate users (sign up, sign in, sign out)?
  3. Resources: Does anyone have recommendations for YouTube playlists or other resources that can guide me through this process?

I appreciate any help or guidance you can provide!

Thank you!

2 Comments
2024/10/31
07:52 UTC

7

JavaFx window doesn't cover fullscreen

I'm not sure why I have this problem.

I just wanna know if anybody else has ever experienced something similar.

When I want to set my JavaFx window to fullscreen using the little "maximise" icon on top -> it normally goes to full screen (as it should).

However when I align the window to be somewhat directly in the middle of the two Screens (actuall desktop screens) it doesn't go up in scale.

I'm using Windows 11 with Openjdk 22 and JavaFx 17.0.2

2 Comments
2024/10/30
12:10 UTC

7

Whats the best way to change scenes in javafx?

I'm new to javafx (i'm using scenebuilder aswell) and i'm trying to build a simple expense tracker project. My question is, what's the best practice regarding switching scenes in javafx ?

https://preview.redd.it/1uy8wtb82wwd1.png?width=1351&format=png&auto=webp&s=94c6f5187602833d21c9757b5f1c75b26a399fd7

For example, the navbar of the app will be something like this and i intend to show different interfaces when the savings button is clicked or when the expenses button is clicked. From what i've seen online there are a couple of ways to do this :

  1. have two fxml files one for savings and one for expenses where you just switch scenes each time.

  2. have one fxml file with both interfaces, and when each button is clicked set visible the one interface and set invisible the other one.

  3. have one common fxml file for the navbar, and then add to the same file either an fxml having the savings interface or the expenses interface

Are there any other ways? Which is the best practice? Which is the most "viable" for a beginner?

19 Comments
2024/10/25
11:40 UTC

2

How to add Textures to FXGL?

1 Comment
2024/10/22
20:18 UTC

5

Custom component in JavaFX(Best practice)

Hello, everyone. A question arose regarding the best practice of creating custom components in JavaFX. For example, we need to draw an atom. An atom contains a nucleus and electrons. What would be the best structure to draw from?

For example:

class Atom extend Pane {

Nuclear nuclear;

List<Electron> electrons;

}

class Nuclear extend Circle {}

class Electron extend Circle {}

Would it be best practice for the aggregator component to inherit from the container (in this case JavaFX Pane)? Is it possible to wrap the nucleus and electron in a container(Nuclear extend Pane) better?

I would be grateful for any tips

12 Comments
2024/10/22
10:02 UTC

24

New Article: CSS Transitions in JFX23

JFX23 is out, and with it we get a new feature: CSS Transitions. I think this is really cool.

I'm a big, big fan of keeping your layout code, as much as possible, to being strictly layout. A certain amount of configuration is always going to creep in, but if you can move that stuff out of your layout code and into somewhere - anywhere - else, then it's always better. A lot of the time, that means moving it into helper functions and builders, but this new feature means we can move it out of the code base entirely.

CSS Transitions are transitions that are entirely defined in the style sheets! There's no code at. You can add transitions, remove transitions, and fine tune them without touching a stitch of code.

In this article, I think I've managed to cover every aspect of CSS Transitions with examples and explanations. I've taken the time to experiment and figure out what works and what doesn't so you won't have to.

Also, I learned how make screen capture GIF's! Previously, I've made videos, posted them on YouTube and then embedded them into the articles. But I really hate how that looks. So much that I wasn't even going to have videos for every example. Then I looked into creating GIF's, and it's soooo much nicer. Now, there's an animation for virtually all of the examples. The GIF's are between 2MB and 3MB, so hopefully it won't cause a lag on loading all ten of them.

https://www.pragmaticcoding.ca/javafx/elements/css-transitions

Anyways, take a look and tell me what you think.

10 Comments
2024/10/20
18:51 UTC

5

RSyntaxTextArea vs RichTextFx, for JavaFx - difference, difficulty?

Hi, I am looking for a textarea to do word searches (no need for stemming etc.), keyword highlighting, formatting of code (only tabs after brackets) .. like that, but that is what I would like to have.

I found these both; did someone of you try them?

(what I see is that the RSyntaxTextArea, one can add a language if it is not there (it is not))

Thank you

6 Comments
2024/10/19
22:38 UTC

7

Syntactic sugar for modern component usage

JavaFX has all the reactivity required from a UI framework, but the syntactic sugar is simply disastrous.

Is there any reason why we can't have this kind of API, which would be analogous to a lot of modern UI framework:

public Node createComponent(int initialCounter) {
  IntegerProperty counter = new SimpleIntegerProperty(initialCounter);
  StringBinding text = Bindings
      .createStringBinding(() -> String.valueOf(counter.get()), counter);

  // AnchorPane is a static method with the same name, static imported.
  return 
      AnchorPane(pane -> pane
              .styleClass("container")
              .cursor(CROSSHAIR),
          // children Node... varargs
          Text(text -> text.text("Counter").strokeStyle(OUTSIDE)),
          Button(button -> button
                  .onClick(_ -> increment(counter, 1)
                  .text(text)
          )
      )
}

Syntax is obviously inspired by ScalaJS. Compared to something like React it is surprisingly similar.

function MyComponent() {
    const [counter, setCounter] = useState(0);

    return (
        <div>
              <h1>Counter</h1>
              <button onClick={() -> setCounter(count + 1)}>
                    Clicked {count} times
              </button>
        </div>
    )
}

I'm currently writing handwritten helper method to achieve this kind of API, but I'm a bit frustrated at the fact that I even had to do so. I would say the bindings are tedious to write, but it makes the reactivity explicit.

5 Comments
2024/10/19
07:56 UTC

7

What is happening to edencoding.com website?

I have a few bookmarks from that website saved but it doesn't seem to work anymore. Does anyone know anything about that?

3 Comments
2024/10/18
10:27 UTC

7

OpenJFX License and MS License

Reading some things I found online, it seems OpenJFX for commercial projects should be free. I found that the JARs contain Windows (seems to be) proprietary DLLs (e.g. javafx-graphics-21.0.4-win.jar). Upon research, it seems like these DLLs come from MS Visual C++ Redistributable, which has this license (https://visualstudio.microsoft.com/license-terms/vs2022-cruntime/ )

In it, there's a part where it says, "You may not · provide the software as a stand-alone offering or combined with any of your applications for others to use, or transfer the software or this agreement to any third party."

That part kind of confuses me. Does that mean I can't include these runtime files with my app?

If I build a software for the Windows platform, how does this legally affect my product? Is there some special thing i need to do? Is OpenJFX really still free to use?

Thanks in advance!

4 Comments
2024/10/18
03:31 UTC

2

Java fx in vsc

I want correct steps to use java fx in vsc Note that I have done many steps in which I tried to run the java fx code, but the error message appears Error: JavaFX runtime components are missing, and are required to run this application

10 Comments
2024/10/17
19:18 UTC

2

Noob tries JavaFX, questions have arisen

Hi,
I have a scene with radiobuttons on one side (grouped in a togglegroup), a pie chart and a couple of DatePickers.
The idea is to select what data the user wants to see in the pie chart with the radiobuttons and filter the date(and time, via comboboxes) period.

I have attached a function to get the respective data to the radiobuttons (basically a bunch of SQL queries), but now, how do I make it so that the functions are called again(they take the values of the datepickers and time comboboxes) when said controls are clicked (i.e. the user selects the dates)?

4 Comments
2024/10/17
14:23 UTC

0

Module javafx.graphics not found

I tried download javaFX on eclipse and now I keep getting this error message. Any Idea why?

2 Comments
2024/10/17
02:06 UTC

0

Null FXML file

https://preview.redd.it/ygd139i3zrud1.png?width=267&format=png&auto=webp&s=da558fcf385ad3fd63712e6e4d50a01bd2e6ea36

So im building a peice of softwaare and getting aggravated with this null im getting when i call the FXML file from my java code (Attached photo). I have tried so many things i could find online and nothing is working. I am using java, javafx, css, mysql, and wrapped in gradle. i have this project working without gradle as well. But i am trying to get everything working with Gradle, and this is where im getting a null when i cvall the file from my Main.java.

here is my test im running; which return null whatever i seem to do.

System.out.
println
(
getClass()
.
getClassLoader
().
getResource
(
"FLuiD.fxml"
));
12 Comments
2024/10/14
19:43 UTC

3

Jar file issues with Javafx

When i compile on Windows and run my Jar file on Linux i Get this error

Graphics Device initialization failed for : d3d, sw

Error initializing QuantumRenderer: no suitable pipeline found

When I compile jar file on Linux and run on windows i get this error

Graphics Device initialization failed for : es2, sw

Error initializing QuantumRenderer: no suitable pipeline found

How do i fix this cause if i run jar file on same machine no problem. My project requires the jar file to work on both linux and windows any help would be appreciated thanks.

6 Comments
2024/10/13
02:37 UTC

8

Executing a JavaFX application without downloading

I have a friend that is requesting an application that I will be using javaFX for. I have the JavaFX SDK 20 downloaded on my mac and can run the program that way, but I want to package the program in a way where my friend does not have to download the sdk file? How would I do this?

13 Comments
2024/10/11
21:54 UTC

41

Announcing DevToolsFX

Originally intended to fix long-standing bugs in Scenic View, it has been completely rewritten from scratch.

GitHub link

Key differences:

  • Modern Java.
  • Reduced, more maintainable codebase with clear model/UI separation.
  • Only depends on javafx.controls.
  • Additional features: stylesheet and environment exploration, including the latest JavaFX Preferences API. Dark theme coming soon.
  • No separate desktop app yet (only embedded). Still deciding between RMI or WebSocket.
  • No property editing support, as it complicates the code unnecessarily.
10 Comments
2024/10/11
05:09 UTC

19

Feedback Request: ArchitectFX - A Modern JavaFX View Builder

Hello everyone,
I'm Alex (aka palexdev), and today I'm here to ask you some feedback about my latest project.

Overview

ArchitectFX aims to replace SceneBuilder for quickly building/prototyping JavaFX views It's not intended to be an exact clone, but the core functionality should be pretty much the same. The goal is to have a flexible and customizable tool with an elegant and modern UI, which offers equal support for JavaFX and third-party libraries. (By the way, progress is tracked on Trello)

Current Focus

Given the project's scale, my current focus is not to offer the functionalities of an editor such as SceneBuilder, but rather a mode that doesn't allow direct edit. This mode (which I still don't know how to call, “Live Preview” perhaps?) would just parse the view from a file and shows it to the user. By changing the document, the preview auto-reloads. It's designed for a split-view setup, where you have your editor on one side and ArchitectFX on the other. I just finished implementing the document loader, which leads us to…

One key difference

Unpopular opinion warning, please don't blast me: XML sucks, I hate it so much you have no idea. Which is why ArchitectFX does not use FXML to define views, but rather YAML. It may not be ideal for tree structures of this kind, but I like the concise syntax.
I called this format: JDSL (Java Deserialization Language). While it's true that I'm developing this format specifically for this project, I'm also quite confident in saying that with some minor adjustments it could be used to recreate any kind of Java object. Check this test document for a preview of its capabilities.

Tests

I did not run extensive tests on performance, all I can say is that JDSL appears to be 2/3 times slower in loading the same FXML view I posted above. I’m working on parallelizing some tasks to improve the situation, but this part of the code is still experimental and untested. That said, JDSL is a bit more powerful and flexible than FXML, you can literally call methods and build objects with factories lol.

The Community

This project is fairly complex, especially considering that I'm relatively new to some of the techniques and mechanisms used ArchitectFX (for example reflection, class loaders, I have never worked with them before). I would really appreciate receiving some constructive feedback about the current work and the format. If you have some spare time, it would be great if you could either:

  • Try converting some of your views in JDSL, loading them and report back for pros and cons, issues and whatnot.
  • Inspect my code for bad patterns, potential fixes and improvements. Report back or…
  • Contributions would be extremely valuable. After all, ArchitectFX is a tool built by the users, for the users.

I’m eager to hear your feedback. Thanks in advance for your time and insights!

— Alex

41 Comments
2024/10/09
20:37 UTC

16

New Article: Beginners' Guide to Properties

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

7 Comments
2024/10/09
18:11 UTC

3

MacOS transparent title bar

Hey there!

I recently started experimenting with JavaFX in combination with FFM on MacOS to manipulate the window features.

I've managed to extract the used NSWindow object and set the titlebar to transparent and also the contentview to full.

However, now I cannot move the window.. Only if I manage to drag from within a very tiny area (1-2 pixels height) at the top of the window, it moves, but if I try it from where the titlebar was before, no chance..

I'm kind of stuck at this point and hope someone from this community can help me :)

Edit: Figured it out... If anyone's interested: https://stackoverflow.com/questions/79056695/javafx-macos-window-not-movable-with-transparent-titlebar

5 Comments
2024/10/05
23:09 UTC

7

Responsive Application

I have previously developed two projects on using JavaFX a currency converter and An Internet download manager. I was cooked while trying to make them responsive and at the end I just fixed the resolution so that no one resize or maximize it. But now I was building this chat room so this time I want to make it responsive, I can't find any youtube tutorial demonstration responsive application. Can one here help me overcome this issue I mostly use anchor pane

8 Comments
2024/10/04
17:41 UTC

4

JavaFX project Structure For Bachelor Thesis!!

Hello, I am currently working as a backend developer mainly using Java, and am also a student in robotics engineering. My thesis will be about controlling a Robotic hand with a glove full of sensors in real time and also being able to record motions with the glove and being able to play them back for the robotic hand, I will be using an arduino to control the hardware, but I also need to make a GUI, preferably using JavaFX, the goal is to have a 3d rendering of the hand in the GUI that moves in real time with the glove, and maybe even being able to move the 3d model with the cursor to also move the robotic hand. The issue is, how can I have this 3d model of the hand in my project, I am not sure what technologies are needed, for example if I should use blender or something else... to implement this, I am quite good at backend but this part of my project falls more into game design which can actually be cool for me to learn, so if anybody has any ideas or good resources for me to be able to implement this it would be nice. I have some experience in using Java Swing but only for simple desktop applications, not any experience with anything 3d.

3 Comments
2024/10/03
07:57 UTC

19

JavaFX 24 will probably bump minimum Java version to 22

... and I think that's a good thing.

https://github.com/openjdk/jfx/pull/1588

8 Comments
2024/10/03
02:28 UTC

1

JavaFx for a Currency Converter project

Hello, I'm currently trying to add JavaFx to a program I made, and don't have a lot of knowledge on javafx in general. I'll include the code that I've designed, but if anyone would be able to help I would greatly appreciate it! This is also only first java project/java code that I've worked with/made so go easy on me if you can lol.

I currently have 3 classes:

I'm still working on the CurrencyTest.java (I can't quite figure out how to get the code situated to test all of the different currency conversions without messing the code up entirely)

CurrencyConverter.java

Main.java

CurrencyTest.java

Edit: I've added the github link below, sorry for the scrolling headache

https://github.com/tneal51/CurrencyConverterProject/blob/8627f0fc00439fd283b22cb9127ca842f47ae61b/Currency%20Converter%20Project

6 Comments
2024/10/02
17:26 UTC

Back To Top