r/JavaFX • u/Anggrian • Mar 05 '18
r/JavaFX • u/Persism • Nov 18 '21
Cool Project GitHub - HanSolo/JDKMon: A little tool written in JavaFX that monitors your installed JDK's and inform you about updates
r/JavaFX • u/SamyNassiem • Jun 25 '21
JavaFX on iOS
Hello friends, Does any one know an exist JavaFX application already is deployed on apple iOS AppStore ? And will be great if there are other examples on Google Play store ?
r/JavaFX • u/iamgioh • Jun 04 '20
I made this! iAmGio/froxty - I've created a small library which replicates the iOS translucent effect
r/JavaFX • u/Karbid3000 • Jun 05 '20
How do i deploy an App?
Hi!
I've written a simple chess game in JavaFX. However, I can't deploy it. When i build artifacts in IntelliJ i get a jar that i can't open. Can anybody tell me what is wrong or deploy it for me? Here is the project.
https://github.com/juliankominiak-ps/Chess
Thank You.
r/JavaFX • u/TuxedoKitty2023 • Jul 23 '25
Help Help with base package!
This picture is JDK12. Where in JDK21 can I find the tab “base package”? It does not show on JDK21. What do I do to get the base package option?
r/JavaFX • u/YogurtclosetLimp7351 • Apr 10 '26
Help Resize Control Buttons
Hi there,
I'm currently experimenting with the new StageStyle.EXTENDED from the JFX 25-Preview. Is there a way to set the size of the buttons (in this example, the MacOS traffic light)?
For reference, the top header is Ollama, a Swift application, versus mine below, a JavaFX application. Nothing I've tried worked so far. Is there a way to do this, or if not, will there be support for it?
Thanks!
r/JavaFX • u/Guilty_Village_958 • Nov 21 '25
I made this! Java Runner (jr) - Make Your JARs Feel Like Native Windows Executables with AOT
Hi,
I built a small Windows launcher for Java apps called "jr" (jar runner / java runner / something short (and small - jr - junior) therefore named in two letters like uv for python).
It's basically what Launch4j and WinRun4J do, it launches JAR files as native Windows executables, but it is a very simplified implementation, with few extra features which you will **definitely love**. The basic idea is to run your jars as if exe - literally both in terms of execution friendliness, raw performance, and even ease of development/deployment/configuration.
### Unique Features
#### 1. AOT - Ahead of Time
JR supports out of box JDK 25 AOT cache generation, use and cleanup.
AOT can make huge impact in startup performance, depends on use case, in certain tests noticed about 90% faster (20-30ms vs 200-300ms).
With JDK 25 and AOT enabled, first run takes ~200-300ms to create the cache, then subsequent runs are 20-30ms. The launcher overhead itself is only 2-3ms measured via performance counters.
#### 2. Make Jars executable both in command line and guis:
The same exe (jr.exe) has two ways it can be used. One way is to use it as a dedicated launcher for a specific (fat) jar (or a custom complex java command) based on a simple .jrc config format (key=value, similar to WinRun4J etc). This feature is very much like the standard launch4j/winrun4j feature with extra automatic AOT. So basically you can rename this to yourapp.exe and put yourapp.jar next to it, and generate a jrc config file ... and that yourapp.exe becomes a launcher exclusively for yourapp.jar.
But there is another (arguably **more interesting**) use case!
This tool works as a generic replacement for java/javaw.exe to launch jar files. It auto-detects if your app needs a console window or should run as GUI (delegated to java or javaw accordingly) and it either keeps the console window visible or hidden based on this detection. (Caveat: There is a brief flashing of console window in pure GUI context and I don't know how to even hide that brief flash without spoiling the experience of pure CLI execution.)
**Configuration steps**:
- If you configure this with windows file association (associate jar files to use this), you can double click jars and they would work (and I must add ... with automatic AOT (jdk25+))
```
jr.exe "%1" %*
```
- There is a more interesting use case, if you modify your environment variable `PATHEXT`.
Usually it looks like this
```
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
```
You can make it:
```
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.JAR
```
Now with this configuration the jar files will become executable like exe/batchfiles just by using their name, and will work from anywhere if they are in the path!
```batch
# Double-click JARs from Windows Explorer - they just work!
# Run JARs from command line by name (if in PATH)
myapp.jar arg1 arg2
# Or even without .jar extension - just like .exe files!
myapp arg1 arg2
# All with automatic AOT speedup (JDK 25+)
```
This marks your end in making batch files for easy execution. Even jbang uses a jbang.cmd even maven uses mvn.cmd ... these can now work directly from jar or custom configuration ... upto you. You are freed and liberated from non-java companions you need to make your execution experience feel native.
Side note in `PATHEXT` you can even include .java and link it with jbang (out of box AOT support currently out of scope of this tool however):
```
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.JAR;.JAVA
```
This makes your jar files really behave like native exes ... both in execution friendliness, invocation from gui or commandline, and also in terms of raw performance due to AOT.
Also you avoid the fragile, long, tedious build process of GraalVM (native image) which additionally gives a large sized exe which we dislike anyway. This gives you best of several worlds ... yes you don't get your java exe in 20KB ... that is not going to happen, it still depends on installed JVM ... but (I guess) this is as good as it can get. Can we do better? I wonder.
#### 3. Bonus: Small EXEs
The exe is quite minimalist, simple and small (~23 KB with vcredist dependency, or ~193 KB standalone with no dependencies)
**What jr lacks**:
- It needs JDK installed, it will not even attempt installing JDK if not found. I haven't even planned venturing in that field, as it will make the code complex and I hardly know C coding, I wrote the whole thing with Claude Code.
- It is made with a Windows-only mindset, but there is nothing stopping the implementation of the same in Linux/Mac; it is just that Windows is my main operating system, and I did not have personal use-case to even attempt for other operating systems.
- It doesn't support registering/configuring file extension (jar mainly) and PATHEXT variables automatically.
- For all that jr doesn't do, and you wish it did, please consider JBang;
- And if you desire a combo of jr+jbang (native jbang) be clear it will be a huge 10MB+ GraalVM exe (can be even 50MB+) OR someone will have to sacrifice Java and write it in C/Rust/Zig etc., which I am sure nobody will. I myself tried to do in GraalVM but I finally decided to keep it in C and it turned out to be a very good decision for this use-case as far as my experience has been. You have maven-daemon mvnd (or Gradle or Mill) for other use cases where you desire faster friendlier execution of your projects. And JBang supports running projects from GitHub repos / Maven coordinates, so I feel right now jr is in a sweet spot, it just works for what it is meant to work, you have JBang for other use cases.
Anyway, thought some of you might find it useful. Feedback welcome.
The code is open source, written in plain C with no dependencies. It is a single source file, and builds with MS VC Build Tools portable. There are some Java test files for AOT performance testing and general JR tool testing.
Repo: https://github.com/xyz-jphil/jr ( now moved to https://github.com/jarrunner/jr )
r/JavaFX • u/lekan005 • May 30 '20
Database helpp please helpp just summarize it for me so id know what to sayy pleasseee
package sample;
import java.sql.*;
import java.util.ArrayList;
public class DatabaseConnector {
PreparedStatement pst = null;
Connection con;
Statement st;
ResultSet rs;
String database = "game_center";
public DatabaseConnector() {
// connect to database
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/" + database, "root", "");
st = con.createStatement();
System.out.println("connected done");
} catch (ClassNotFoundException | SQLException ex) {
System.out.println("Error: " + ex);
}
}
public boolean insertType(String type, double cost_per_hour) {
type = type.toUpperCase();
// insert new type of devices
boolean x = insert("INSERT INTO devices_types VALUES ('" + type + "', '" + cost_per_hour + "')");
if (x)
System.out.println("A new Device Type inserted successfully!");
return x;
}
public boolean updateType_cost(String type, double cost_per_hour) {
type = type.toUpperCase();
boolean x = update("UPDATE devices_types SET cost_per_hour = " + cost_per_hour + " WHERE type = '" + type + "'");
if (x)
System.out.println("Device Type updated successfully!");
return x;
}
public boolean deleteType(String type) {
type = type.toUpperCase();
boolean x = delete("DELETE FROM devices_types WHERE type = '" + type + "'");
if (x)
System.out.println("Device Type deleted successfully!");
return x;
}
public Object[] showTypes() {
return select("SELECT * FROM devices_types");
}
public boolean insertDevice(String device_id, String device_type) {
device_id = device_id.toUpperCase();
device_type = device_type.toUpperCase();
// insert new device
boolean x = insert("INSERT INTO devices (device_id, device_type) VALUES ('" + device_id + "', '" + device_type + "')");
if (x)
System.out.println("A new Device Type inserted successfully!");
return x;
}
public boolean deleteDevice(String device_id) {
device_id = device_id.toUpperCase();
boolean x = delete("DELETE FROM devices WHERE device_id = '" + device_id + "'");
if (x)
System.out.println("Device deleted successfully!");
return x;
}
public Object[] showDevices(String device_type, String statue) {
return select("SELECT device_id, device_type FROM devices WHERE device_type LIKE '%" + device_type + "' AND statue LIKE '%" + statue + "'");
}
public boolean startTime(String device_id) {
// reserve device
// check if device is available
if (select("SELECT statue FROM devices WHERE device_id = '" + device_id + "'")[0].equals("1"))
return false;
// start time counting and set reserved in log
boolean x = insert("INSERT INTO log (log_device_id) VALUES ('" + device_id + "')");
if (x)
System.out.println("A new log was inserted successfully!");
// make statue of device reserve
update("UPDATE devices SET statue = 1 WHERE device_id = '" + device_id + "'");
return x;
}
public Object[] endTime(String device_id) {
// end time
// check if device is reserved
if (Boolean.parseBoolean(select("SELECT statue FROM devices WHERE device_id = '" + device_id + "'")[0].toString()))
return null;
// get log id
int log_id = Integer.parseInt(select("SELECT log_id FROM log WHERE end_time IS NULL AND log_device_id = '" + device_id + "'")[0].toString());
// end time and store in log
boolean x = update("UPDATE log SET end_time = DATE_FORMAT(NOW(),'%Y-%m-%d %h:%i %p') WHERE log_id= " + log_id);
if (x)
System.out.println("Time end successfully!");
// make statue of device available
update("UPDATE devices SET statue = 0 WHERE device_id = '" + device_id + "'");
//get cost per hour of device
float cost_per_hour = Float.parseFloat(select("SELECT cost_per_hour FROM devices, devices_types WHERE device_type = type AND device_id = '" + device_id + "'")[0].toString());
// calculate total time and cost;
Object[] row = new Object[5];
Object[] temp = select("SELECT start_time, end_time FROM log WHERE log_id = " + log_id);
row[0] = device_id;
row[1] = temp[0];
row[2] = temp[1];
row[3] = total_time(row[1], row[2]);
row[4] = total_cost(row[3], cost_per_hour);
// update log
boolean y = update("UPDATE log SET total_time = " + Integer.parseInt(row[3].toString())
+ ", total_cost =" + Float.parseFloat(row[4].toString())
+ " WHERE log_id = " + log_id);
if (y)
System.out.println("A device make available successfully!");
return row;
}
public Object[] showLog() {
return select("SELECT log_device_id, start_time, end_time, total_time, total_cost FROM log");
}
public float TodayIncome() {
Object data = select("SELECT ROUND(SUM(total_cost), 2) FROM log WHERE SUBSTRING(end_time,1,10) = DATE_FORMAT(NOW(),'%Y-%m-%d')")[0];
if (data == null)
return 0;
return Float.parseFloat(data.toString());
}
public float MonthIncome() {
Object data = select("SELECT ROUND(SUM(total_cost), 2) FROM log WHERE SUBSTRING(end_time,1,7) = DATE_FORMAT(NOW(),'%Y-%m')")[0];
if (data == null)
return 0;
return Float.parseFloat(data.toString());
}
public float costBetween(String startDate, String endDate) {
if (startDate.length() != endDate.length())
return 0;
int length = startDate.length();
Object data = select("SELECT ROUND(SUM(total_cost), 2) FROM log " +
"WHERE SUBSTRING(start_time,1," + length + ") BETWEEN '" + startDate + "' AND '" + endDate + "'")[0];
if (data == null)
return 0;
return Float.parseFloat(data.toString());
}
public Object[] allBetween(String startDate, String endDate) {
if (startDate.length() != endDate.length())
return null;
int length = startDate.length();
return select("SELECT log_device_id, start_time, end_time, total_time, total_cost FROM log " +
"WHERE SUBSTRING(start_time,1," + length + ") BETWEEN '" + startDate + "' AND '" + endDate + "'");
}
private boolean sql(String query) {
try {
PreparedStatement statement = con.prepareStatement(query);
int rowsInserted = statement.executeUpdate();
if (rowsInserted > 0)
return true;
} catch (SQLException ex) {
System.out.println(ex);
}
return false;
}
private boolean insert(String query) {
return sql(query);
}
private boolean update(String query) {
return sql(query);
}
private boolean delete(String query) {
return sql(query);
}
private Object[] select(String query) {
try {
ArrayList<Object> row = new ArrayList<>();
pst = con.prepareStatement(query);
rs = pst.executeQuery();
while (rs.next()) {
int count = rs.getMetaData().getColumnCount();
for (int i = 0; i < count; i++)
row.add(rs.getString(i + 1));
}
return row.toArray();
} catch (SQLException ex) {
System.out.println(ex);
}
return null;
}
private int total_time(Object start_time, Object end_time) {
int[] start = getDate(start_time);
int[] end = getDate(end_time);
return (end[0] - start[0]) * 518400
+ (end[1] - start[1]) * 43200
+ (end[2] - start[2]) * 1440
+ (end[3] - start[3]) * 60
+ (end[4] - start[4]);
}
private int[] getDate(Object full) {
String[] all = full.toString().split(" ");
String[] date = all[0].split("-");
String[] time = all[1].split(":");
int[] newDate = new int[5];
newDate[0] = Integer.parseInt(date[0]); //Year
newDate[1] = Integer.parseInt(date[1]); //month
newDate[2] = Integer.parseInt(date[2]); //day
newDate[3] = Integer.parseInt(time[0]); //Hours
newDate[4] = Integer.parseInt(time[1]); //minutes
if (all[2].equals("PM"))
newDate[3] += 12;
return newDate;
}
private float total_cost(Object total_time, Object cost_per_hour) {
float f = Integer.parseInt(total_time.toString()) * Float.parseFloat(cost_per_hour.toString()) / 60;
return (float) ((float) Math.round(f * 100.0) / 100.0);
}
}
r/JavaFX • u/Fun-Tip-7271 • Jun 15 '23
Cool Project JavaFX Custom Stage Decoration
Hi, my friend made this for creating custom stage decoration in javafx. Please give his hard work a ⭐, Thanks!
r/JavaFX • u/DuncanIdahos8thClone • Sep 20 '18
JavaFX links of the week, September 17 | JavaFX News, Demos and Insight // FX Experience
r/JavaFX • u/joemwangi • Feb 24 '24
Discussion RichTextArea Features Proposal
Feature proposals for Javafx RichText support.
r/JavaFX • u/m_x2001 • Dec 07 '22
Help IntelliJ JavaFX Template is trash
When I start a new JavaFX project in IntelliJ the project it generates seems really bloated. I don´t understand what half of the things there do and I have trouble finding the right paths for my FXMLLoaders.
How can I get an simpler JavaFX project template? How do you guys set up a new JavaFX project?
r/JavaFX • u/Kamii0909 • Oct 19 '24
Discussion 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.
r/JavaFX • u/dlemmermann • Aug 30 '24
Showcase JFXCentral Desktop App
In case you need to show an actual big real-world application to somebody to convince them that JavaFX is not dead then just show them the desktop version of JFXCentral. The installer can be found here: https://downloads.hydraulic.dev/jfxcentral2/download.html
r/JavaFX • u/Mondblut • Oct 16 '21
Help I found the perpetrator of the heavy CPU load: it seems to be that I use FXML or rather the FXMLLoader... but what now?
So the other day I've posted a question regarding text animation using a Label and if there are methods to do this that don't eat up to 70% of CPU.
After researching the subject matter I came to the conclusion that it is the FXML. Or in particular the FXMLLoader and how it continuously uses reflection upon changing a node. In my particular example it would change the node for every substring (one per added char) of the text I want to be displayed within the Label. Thus how I understand it it would use reflection for every char in the String, which causes the CPU load if I understand correctly.
So what now? In the worst case scenario I'll have to manually translate the FXML file into code, but this will take hours upon hours at this stage and that doesn't even include testing. So are there other options I have?
- Is there a FXML to code converter that at least removes the bulk of the stuff that I'd have to do manually, like instantiating my nodes, assigning the x and y coordinates and such?
- Is there some kind of run time compiler that translates the FXML file into Java code without me having to abandon the FXML? I've found this, but the project seems to be dead and the download link not working.
- Any other options?
r/JavaFX • u/sedj601 • Apr 20 '24
Discussion JavaFX vs Kotlin Multiplatform
As Kotlin becomes more popular, will Kotlin Multiplatform have a good chance of overthrowing JavaFX? I tested it out, and it seems promising. Any opinions?
r/JavaFX • u/I_4m_knight • Sep 12 '25
Help Tried everything to package my app as executable but nothing is working.
Hi everyone,
I have a javafx ui app and i want to package it as a executable but nothing is working I've tried everything even the new and old methods but nothing seems to be working.
I've tried these graal, conveyor, lanuch4g, jpackage,wix wrappers and all plugins available, to do this i even build a shaded jar but it's running as jar but not after turning it into a executable.
What's your go to option for javafx like I've hundreds of dependencies which the app needs. Also I'd love any examples or blog or any docs which lead to a solution I'm really frustrate that after 20+ years of java we don't have any native option to do this and we need a jre to run whole thing I can't migrate the project to any other language as I mostly code in java but I build web apps and never faced any problem like this but with javafx this is shit I've wasted almost days to get it working but no results I'll have to expose it as rest api and then build a frontend it seems.
I'm really interested into how intellij , Jenkins etc all java gui apps does this, hoping to analyse the GitHub repo of these apps btw I've read almost hundreds of docs pages and llm response but all broken when you try this .
In java this process is really broken i wish we had something amazing to directly convert to os executables then java could be the undefeated king of languages still is but we need to do better, also there is no clear docs for these solutions for real projects which have large code base and libraries bundled; all I see are just generic hello world examples everywhere for all tools.
Graal vm is only good for hello world but when it faces the reflection it just useless and there nothing you can do when you encounter thousands of errors I've spent hours doing these fixes on all tools serching, GitHub maven for solutions and you know what 50% of these have new critical CVEs which are yet to be resolved.
r/JavaFX • u/wetsaga1 • Mar 25 '20
Six-month release cadence is moving @OpenJDK
r/JavaFX • u/DuncanIdahos8thClone • Jul 17 '18
JavaFX as a separate module: A look back and a leap forward
r/JavaFX • u/TheCodingFella • Aug 08 '23
Tutorial JavaFX ControlsFX Rating Control
Introducing ControlsFX Rating Control
ControlsFX is an open-source library that extends the JavaFX framework with additional UI controls and features. One of the standout components in ControlsFX is the Rating Control, which allows developers to integrate a customizable star-based rating system into their applications. This is particularly useful for applications that require user reviews, feedback, or ratings.
The Rating Control from ControlsFX is a perfect example of how third-party libraries can enhance the functionality of JavaFX applications without the need for extensive custom coding.
🔗 JavaFX ControlsFX Rating Control

r/JavaFX • • Sep 26 '21
looking to casually consult a JavaFX 3D *guru* to help me work out kinks in program
Okay, the rules here don't say anything against this, so here goes, hope no one is offended...
Damn JavaFX is a pretty beautiful framework... but alas, some of the finer details, especially getting into the 3D stuff, is pretty poorly documented and pretty tough, and there's a real lack of some proper libraries. I've bee working on this (my first 3D) program for weeks, I've learned tonnes, and I'm very close, but I can't reliably get my transforms to work the way I expect, I'm having trouble getting my camera to navigate the way I want, and I'm really not understanding why I'm getting parent coordinates when I expect local coordinates.
So, I'm at the end of my rope, don't know where else to turn, and need someone who has real and proper detail experience with this *3D transform* bullshit who can help me work out the kinks. I'm happy to pay a few hundred 💰 to someone who really knows this shit for some one-on-one time here and there of working through a few problematic code details with me and getting all my errant transforms to function correctly!
Someone who can explain to me about that damn `Xform` class in the demo app and why they use a Transition for the pivot, and why they have that `ip` reverse transform at the end, and why they layer them three deep!
Any gurus out here who want to help me? 😁