Click here to Skip to main content
15,886,776 members
Everything / JavaFX

JavaFX

JavaFX

Great Reads

by Tiancheng Hu
New samples of using ThinkAlike to accomplish Android/Desktop cross-platform development, including helloworld, Web API access and widget UI.
by Tiancheng Hu
New samples of using ThinkAlike to accomplish Android/Desktop cross-platform development, including helloworld, Web API access and widget UI.
by ireland94
This program demonstrates the methodology needed for by directional messaging between a Java FX foreground and 1 or more background threads.
by Tiancheng Hu
Using ThinkAlike, an ongoing Java MVVM framework(employing Android and JavaFX as view layer), to implement a cross-platform HearthStone game card reference and more.

Latest Articles

by ireland94
This program demonstrates the methodology needed for by directional messaging between a Java FX foreground and 1 or more background threads.
by Tiancheng Hu
New samples of using ThinkAlike to accomplish Android/Desktop cross-platform development, including helloworld, Web API access and widget UI.
by Tiancheng Hu
New samples of using ThinkAlike to accomplish Android/Desktop cross-platform development, including helloworld, Web API access and widget UI.
by AjithKp560_
Creating a simple animation using sequence of images

All Articles

Sort by Score

JavaFX 

15 May 2015 by Tiancheng Hu
New samples of using ThinkAlike to accomplish Android/Desktop cross-platform development, including helloworld, Web API access and widget UI.
30 Aug 2016 by Tiancheng Hu
New samples of using ThinkAlike to accomplish Android/Desktop cross-platform development, including helloworld, Web API access and widget UI.
17 Jul 2019 by ireland94
This program demonstrates the methodology needed for by directional messaging between a Java FX foreground and 1 or more background threads.
22 Feb 2019 by RickZeeland
You probably want a Progressive web app, read article here: Progressive web apps in Java | Vaadin[^] Also see: 10 Best Java Web Frameworks to Use in 2019 (100% Future-Proof)[^] And: https://dzone.com/articles/most-popular-java-web-frameworks[^]
1 May 2022 by OriginalGriff
It's called an Unbounded Wildcard[^]
7 Apr 2015 by CHill60
You need to include the AND within the selection criteria (the AND is SQLite not part of the Cursor construction).Try the following instead (helper.TX_ID + "='" + name + "' AND " + helper.TX_DATE + "='" + td + "'"), You may also find the following article of interest A Simple Android SQLite...
4 May 2016 by Patrice T
I have the feeling that this{aaa,aab,aac,aad,aae}is supposed to be a list of strings.In this case the correct syntax is{'aaa','aab','aac','aad','aae'}You simply forgot to say they are labels.I know it's boring.[UpDate]You question containQuote:The loop is supposed to assign...
1 Apr 2021 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
18 Sep 2014 by Richard MacCutchan
See www.google.com/search?q=USB+port+block%2Funblock+code+in+java[^].
28 Oct 2014 by hemant malpote
I have text file on server.User can read it and write in it.I want to put write lock on file when first user come and open it ,If another user comes in between and open the file he should just read the file not allow to write in file.
28 Oct 2014 by TorstenH.
simplest approach:Use a custom object "FileWithLock" instead of "File". You can simply set a lock on that one and react.import java.io.File;public class FileWithLock extends File{ private boolean locked = false; public FileWithLock(String pathName){ ...
29 Oct 2014 by hemant malpote
When one thread acquire Interruptibly lock on one method and goes for sleep , And another thread run and try to lock the same method it should throw exception but i am not getting any exception.import java.util.concurrent.locks.ReentrantLock;import java.io.*;import...
30 Oct 2014 by hemant malpote
When one thread lock any method after that other process comes and try to access locked method it does give any exception or any notification that method is locked, it just don't execute that method.I want any notification or any exception on that case.
19 Nov 2014 by CPallini
You should put the mix/max tests inside the for loop:for(i=0;ix) { x=suma[i]; } if (suma[i]
13 Mar 2015 by Darren_vms
Without the exception I'm still going to take a punt at the answerObject selectedItem = urlCombo.getSelectedItem();scUrlCurrent = selectedItem.toString();try changing that toscURLCurrent = (String) urlCombo.getSelectedItem();See if that helps/Darren
18 Mar 2015 by ImanG
This method creates a treetableview dynamically. The problem is when I scroll to see the whole table or expand/collapse a treeitem, the position of word "yes" which is at first on cells which have same row and column name, changes. private TreeTableView...
22 May 2015 by mist303
I have created a class called App that extends Application (JavaFX). In it, I have 2 stages that are displaying a few buttons. This App class is instantiated in main then passed as an argument to another class/thread called Controller (a has-a relationship). Once Controller receives an event, it...
10 Jun 2015 by javachessgui
I want to include fonts with my JavaFX application in the jar executable.font_stream = Javachessgui2.class.getResourceAsStream("resources/fonts/"+current_style.font); chess_font=Font.loadFont(font_stream, piece_size);This code works for certain fonts, but not all TTF...
8 Aug 2015 by MstarKiss
I was faced with the problem.I resolved follow as. 1. uninstall already installed all jdk. 2. install jdk1.6u29. 3. link jfxrt.jar of JavaFx2.2 SDK in eclipse project. 4. export runnable jar. 5. when running exported runnable jar, refer to dlls of JavaFx2.2then you can run...
30 Dec 2015 by Duncan Edwards Jones
Not really - because java runs on a JVM which in turn runs on top of an operating system.You could write a kernel in another language then write the rest of the "operating system" on top of that..Take a look at OSDev Wiki[^] for all aspects of developing an operating system to get you...
17 Mar 2016 by Member 12399879
I am not able to add new tab functionality to browser.I already search a lot on google as well as on stackoverflow but nothing work.I want to load main fxml file again by clicking on new tab button.Below is Main.java filepackage tabcheck;import javafx.application.Application;//all...
21 Mar 2016 by Florian29461
Hello together, i want to add one sceenbuilder fxml multiple times to another sceen with diffrent data. For each dataset add one fxmlCalendar.fxml to the main sceen with the specific data from database. Can you help my by this problem? I don't know any other way to solve this.Image...
8 Jul 2016 by JfxDev
I have a reproducible problem with the Mint Cinnamon desktop locking up when hitting a breakpoint debugging with Eclipse. When I say it's locking up, I mean mouse clicks are completely inoperable (even on the Mint panel). Alt-Tab looks like it's working, but selecting another window doesn't...
16 Apr 2019 by Himani Virmani
I am unable to understand how to use setCellFactory method to format individual TreeItems.I have a classpublic class Bag {public String caption,assignment="";Boolean eval;public Set Nodes = new HashSet();public Vector ChildBags = new Vector();...
1 Nov 2016 by Member 12373848
I am developing a JavaFX application & a C++ dll whose method i want to call from JavaFX (java code). So, i have placed the dll in project directory, getting the working directory during runtime , hence creating the path to dll , setting the same path value to "java.library.path" & then loading...
31 Oct 2016 by KarstenK
The called function isnt properly exported with JNI from your C dll, maybe it is only the wrong data type as parameters. The first is ALWAYS the JNI pointer. Here is a fine looking tutorial where all is explained.JNI works that way, so take care to implement the c-dll in this manner.
23 Nov 2016 by KD Palekar
I want to hide or disable or remove that default windows buttons(min,max & close). I tried several things but result zero. Is there any way to do it?ORThere is any way to create a custom form like Windows but without those buttons.Please HELP!!!What I have tried:package...
22 Nov 2016 by KD Palekar
so the answer is I have to write the IF CONDITION as below :if (user == null || user.isEmpty() || pass == null || pass.isEmpty())THE ANSWER IS GIVEN BY Richard Deeming HUGE THANKS SIR!!!
6 Dec 2016 by Christian Lisangola
I'm trying to populate TableView with user data from mysql database but only the last record informations of my user table is returned.What I have tried:Connection peace of codepublic class LoadUsers{ ObservableList personData= FXCollections.observableArrayList();...
24 Dec 2016 by KD Palekar
I want to import the GIF to my JFrame form.What I have tried:What I did is I just directly dragged and drooped the GIF to the JFrame form. It did not worked. Second thing I tried is I import imageview first and then select that GIF path. It's also didn't worked. It's showing in Scene...
1 Jan 2017 by aboosidhu
I have created a dynamic table with checked box.I want to disable an entire column(for example: in attendence marking system the Sunday column should be un markable).I know generally we will use use this code to disable a column.columnName.setEditable(false)So How i can apply this method...
20 Feb 2017 by Adra@SRM
Can you explain how to display the dates and integer values between two dates using hashmap, and it should be displayed in listview in javafx.Example: Suppose, I need the dates and values between 10-02-2017 and 20-02-2017, so that the dates and the values are displayed between those values...
20 Feb 2017 by Richard MacCutchan
listItems.add(map.get(date1));Your call to map.get returns an integer value (10, 20 etc) but listItems.add requires a String.As clearly stated in the error messages.
20 Jun 2017 by CPallini
Quote: My experience with Java is really small and I don't really know where to start. You should start reading some Java tutorials, Google is your friend[^].
21 Jun 2017 by Patrice T
Quote: I need to develop a Navigation System for my university a final project. Ok, go on. Quote: My experience with Java is really small and I don't really know where to start. ... I really need some help and would be thankful for every suggestion or hint!!! May be you should choose a...
11 Dec 2017 by Jochen Arndt
The posted code is C, not C++. If you only want to convert the algorithm, create Java classes for the point and rect structs with the required member functions (construction, copy, get, set), and make vcode a function accepting references to those classes. Or rewrite the code first as C++ with...
7 Mar 2018 by Member 13476370
I am a javaFX beginner and Spent a lot of time designing my calculator GUI on `Scene Builder 2.0` and setting suitable size for every element on the scene . However, when running the project on eclipse sizes differ and the text on `textField` and `Label` won't show.and that's crucial because I...
11 Apr 2018 by Member 13769923
I have an xml file with a root node called Assignments and if l add a an child element called Assignment it successfully adds with all properties date,course etc....the problem arises if l try adding another assignment instead of adding it overrides the previously inserted data What I have...
24 Jun 2018 by wandaga1
//this method gets Telephone number from a sipserver public void telephoneNumbs(String numbers) { String replace = numbers.replace("sip:", "").trim().replace(".", ""); // Incoming Call Numbers from Sip UA if (!replace.isEmpty()) { List telephons; ...
24 Jun 2018 by wandaga1
Sooo much happy today it went well with after 2days of thinking how to solve this miserable life of not taking time to think. I finally got the answer by using Task to solve the problem. Task task = new Task() { { updateMessage(""); } ...
17 Jul 2018 by Drekel
am trying to communicate between two client frequently (ClientA. Server. ClientB) If ClientA send a message it goes to server then server sends it back to ClientA instead of sending that message to ClientB. same thing with ClientB both client can't communicate with each other but can connect to...
28 Jul 2018 by Member 13929074
The button is defined in Class A the scene of Class is being passed to a different class B so the Action Event should work in B's stage. So the Question is how to do it. What I have tried: I have tried to do it but the actionevent doesn't work I want to close the scene of A which I passed to...
19 Nov 2018 by Richard MacCutchan
Caused by: java.lang.NullPointerException at employee.view.MainController.initialize(MainController.java:71) Use your debugger to trap execution at or near that line and see what is causing the null pointer exception.
29 Nov 2019 by evaboy
Please l need help. I want to create a desktop app that users can interact with using a browser. Just like how Xampp or Nessus works. When user downloads and installs the app, user types the given url on the browser to run and operate the app. Thanks What I have tried: I have heard about GWT...
4 Oct 2019 by Swapnil722
I've two Controllers 1. `FXMLDocumentController` has `TableView` CustomerTable. 2. `NewCustomerController` a second Controller to add a new row. I can pass values from First Controller to Second Controller. But I'm not able revert it from Second Controller to First Controller. What I...
29 Nov 2019 by evaboy
Thanks everyone for contributing. Lately, l discovered that Springboot is just the perfect answer to my question. Cheers
16 Feb 2020 by dolfijn3000
hello everyone. I'm making an application where I have a grid cell. in there i wanna place controls that fille the whole-cell width. i achieved this with a button but i cannot get it to work with my custom control. this is the code i usse for the...
16 Feb 2020 by dolfijn3000
ok i fixed it. was a stupid mistake from me. the problem was that when i added my control i did this gridPane.add(w,0,1); but it needed to be gridPane.add(w.controller.Main,0,1);
27 Mar 2020 by OriginalGriff
There are many, many things you did wrong, starting right here: Quote: I developed this You Tube Downloader program Downloading YouTube videos is against YouTube terms and conditions, and counts as malicious activity. We do not condone, support,...
2 Feb 2021 by Mr.Corona
I am very new to Java and JavaFX. I have downloaded JavaFX Scene Builder and when trying to create a fxml project by File > New > Other > JavaFX > New Fxml Document, It open a dialog box and when I entered the details and clicked the Finish...
6 Mar 2021 by yusof26
I am having a sell page that contains TextField with the name quantity I want to check if the input quantity by the user is greater than the quantity in the database. Is there any recommendation on how to do it? Any recommendation is appreciated....
6 Mar 2021 by yusof26
I am having a cart page where users can checkout after purchasing the products/medicines. I am having a button named checkout on that page. After clicking that button "CheckOut" I want to update multiple records in MySQL from JavaFX after...
1 Apr 2021 by OriginalGriff
Repost: Deleted. Please do not repost your question; use the Improve question widget to add information or reformat it, but posting it repeatedly just duplicates work, wastes time, and annoys people. I'll delete this one.
18 Apr 2021 by Richard MacCutchan
The documentation is at JGraphX User Manual[^]
20 Apr 2021 by lelouch_vi 2
Hi, I'm exploring javafx now and I'm confuse about the setting the scene with predefine height and width. I'm just wondering what is the unit of measurement used here? Scene(Parent root, double width, double height) What I have tried: ...
20 Apr 2021 by Dave Kreskowiak
There is no unit of measurement. It's whatever you want it to be. Everything works out so long as you are consistent with your use of values and scaling.
20 Apr 2021 by Richard MacCutchan
See Node (JavaFX 8)[^]
24 Aug 2021 by Mark F.
I created a Bean called Category. I need to include a SimpleListProperty in the bean to store children of the category. I get an error that Children is null. Which is probably because it is not intialized. How do I implement this? What I have...
24 Aug 2021 by Mark F.
I included a constructor and initialized the list. public Category() { ObservableList oList = FXCollections.observableArrayList( children ); this.children = new SimpleListProperty( oList ); }
24 Aug 2021 by Mark F.
Adding a constructor and initializing the list as below fixed the issue. public Category() { ObservableList oList = FXCollections.observableArrayList( children ); this.children = new SimpleListProperty( oList...
17 Dec 2021 by Richard MacCutchan
Looks like a simple spelling mistake: mnemonicParsing="false" onAction="#isplayImage" prefHeight="70.0" Shouldn't that be displayImage?
24 Mar 2022 by karem alhij
مجلد جديد.zip - Google Drive[^] Video explaining the entire interface I want the code without using css style . And using javafx only. What I have tried: Request code for a simple interface using java fx
24 Mar 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
25 Mar 2022 by Natann 022
Hello so i have a swing java program and i want to turn it into javafx. how can i achieve this? What I have tried: i try using Swingnode but can't work for some reason i can't import javafx.embed.swing.SwingNode into my project
1 May 2022 by lelouch_vi 2
I'm just curious what does this do in this code? node instanceof ComboBox I tried replacing it with node instanceof ComboBox but eclipse warns me that Type Node cannot be safely cast to ComboBox What I have tried: I...
2 May 2022 by lelouch_vi 2
I'm working with javafx and fxml to make a simple project. I have a method in my project which is supposed to clear all textfields and comboboxes. Rather than setting each textfields and comboboxes values to null one by one. I put all the nodes...
7 Jul 2022 by Kushal P G
Input to your program are 3 strings S1 S2 and S3 of lower case alphabets and no spaces or special characters. S1 and S2 are the same size. Here are the constraints on S1 and S2: In string S1 and S2 the alphabets at the same index can be replaced...
7 Jul 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
2 Apr 2023 by Ameera A
How to make the carGroup, and carGroup1 keep bouncing and when they reach and touch the border or the touch each other, they rotate to the opposite side, I am new to JavaFX and searched about the collision problem but I got confused on how to...
2 Apr 2023 by Richard MacCutchan
Whenever your objects move you need to check their edges to avoid collisions. So if an object is moving to the right, you need to check that its rightmost edge is not at the rightmost edge of the window. When moving up, you check the top edges,...
9 Apr 2023 by JakTheHero
I want to make it so the contents of the second row's contents and the contents of the rows after it are closer to the left. I can't figure out how to do this. Here's what I have so far. What I have tried: ``` GridPane grid = new GridPane(); ...
15 Apr 2014 by Tiancheng Hu
Using ThinkAlike, an ongoing Java MVVM framework(employing Android and JavaFX as view layer), to implement a cross-platform HearthStone game card reference and more.
22 Nov 2016 by Richard MacCutchan
You should try some of the different styles at StageStyle (JavaFX 8)[^].
21 Jun 2014 by AjithKp560_
Creating a simple animation using sequence of images
20 Nov 2023 by Andre Oosthuizen
According to the below link, it is already available when and if it is enabled. Quote: JavaFX support in IntelliJ IDEA includes code completion, search, navigation and refactoring in JavaFX-specific source files (including .fxml and JavaFX .css...
7 Aug 2015 by Member 11484753
Hi, I now make a javafx project and integrate it to swt display using FXCanvas.I refer JavaFX Interoperability with SWTThe project bulid and run successfully in eclipse.But when I export it to runnable jar file, the jar don't run.For SWT only or javafx only, externed jar run...
4 May 2016 by Member 12503492
Label[][][] labels2D = { { {aaa,aab,aac,aad,aae},{aba,abb,abc,abd,abe},{aca,acb,acc,acd,ace},{ada,adb,adc,add,ade},{aea,aeb,aec,aed,aee} }, { ...
21 Jun 2017 by Member 13270908
Hello everybody! I need to develop a Navigation System for my university a final project. My experience with Java is really small and I don't really know where to start. What I have tried: I started creating GUI with JavaFX, but even there I'm not sure if it's the best solution... I really...
27 Mar 2020 by Member 14784364
package youtubedownloader; import javafx.application.Application; import javafx.concurrent.Service; import javafx.concurrent.Task; import javafx.concurrent.WorkerStateEvent; import javafx.event.ActionEvent; import javafx.scene.Group; import...
18 Sep 2014 by Member 11022550
How to write a USB port block/unblock code in java?tell me some API's or classes or function
19 Nov 2014 by Andres Camilo David Lopera
hello to everybody, please somebody can tell me what is wrong with this, i need a program that return the bigger and the smaller number of a array Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4import java.util.*;public class MNyMY{ public static...
13 Mar 2015 by Member 11096170
import java.awt.Dimension;import java.awt.Point;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.ItemEvent;import javafx.application.Platform;import javafx.embed.swing.JFXPanel;import javafx.scene.Group;import...
1 Apr 2015 by neethujayan
How to Create a jar file for a java application with database connection.How can i link sql file to jar.Please provide a solution.
7 Apr 2015 by S.Rajendran from Coimbatore
In my table I have some columns and from them I want to retrive those rows that satisfy the condition of data in 2 columns namely, 'TX_ID' and 'TX_DATE'. If the value in TX_ID is "E" and if the date in TX_DATE is todays date then I want those rows. In the following code I use '&&' and 'AND' at...
2 May 2015 by Albabiyo
hey everyone,-------------i'm developing plugin using javafx and i have a question : i have two different css files. How do I replace a css file when user click a button?thanks
11 Jun 2015 by Tom Paronis
Hello. I'm having trouble putting a menu into an .fxml file. Every example I see does it programatically but I'm trying to declare it in the controller and then wire it up in the .fxml file. In fact, this seems to be a general problem with javaFX; some of the examples are programmatic and...
22 Sep 2015 by Member 11947599
how to import data from text file to viewtable JAVAFX ?!this is my code i want to read from a text file in this orderclassNAME >> WMC >> DIT >> NOC >> CBO >>RFC >> LCOM >>Ca >> Ce ;text file to be inputted to viewtable:classNAME1 13 2 0 14 74 34 2 9classNAME2 3 1 0 3 18 0 2...
29 Dec 2015 by Member 12235902
if i can program an operating system in java, can you give me push to that wayI have experience in java and I coding network programsso what you advice me..
12 May 2016 by Nadyn
Please tell me how to do that the image size was varied along with the size of the window. package tictactoe; import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.fxml.FXMLLoader; ...
21 Aug 2017 by KD Palekar
I have one JavaFX Login Form and there are 2 Text Fields and 1 Login button. and they have connected to Database. What I want do is that when both Text Fields are empty and if user presses on login button there should be prompt saying that "INVALID DETAILS" and if user enters correct username...
23 Nov 2016 by KD Palekar
So here is the solution. Fisrt of all create a java class file & and name it. Here I am giving the name formDecorator.javapackage customform;import java.awt.Insets;import javafx.scene.Node;import javafx.scene.input.MouseEvent;import javafx.scene.layout.AnchorPane;import...
21 Aug 2017 by Member 13371163
It take me more than an hour trying to find ways how to solve it but I can't find solution online, until I realize my mistake. What I've done is instead of setting my textfield to be cleared like this [ textfield.setText(null) ] , I set it to [ textfield.setText("") ] to avoid...
21 Aug 2017 by Member 13371163
It take me more than an hour trying to find ways how to solve it but I can't find solution online, until I realize my mistake. What I've done is instead of setting my textfield to be cleared like this [ textfield.setText(null) ] , I set it to [ textfield.setText("") ] to avoid...
11 Dec 2017 by alexandrkuchinsky
Hello! I recently started learning java. Help please with the translation of this code from c ++ to java. It is necessary to write a program that performs an external window clipping. The program should be based on the algorithm of clipping the rectangular Sutherland-Cowan window. I could write...
20 May 2018 by Member 13836336
Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at...
19 Nov 2018 by Member 14060190
In my program i have to change the color of a string using radio buttons and change the size of the string from the list view. I seem to be running into multiple errors in my listview code and im not sure what the problem is. I am using e(fx)clipse. What I have tried: package employee.view; ...
22 Feb 2019 by evaboy
@RickZeeland: thanks..it was helpful.
18 Apr 2020 by Member 14806047
Just import all the files in any eclipse IDE... Eclipse will automatically provide connection with your database, and now you can convert your jar file to .exe file
2 Feb 2021 by Richard MacCutchan
See Getting Started with JavaFX: Using FXML to Create a User Interface | JavaFX 2 Tutorials and Documentation[^]
18 Apr 2021 by Meso97
I need to convert xml file to graph to generate test cases from it. What I have tried: I tried using jgraphx library but i don't have any documentation to use it, so i didn't understand any thing.