Skip to content

Tag: javafx

Making a search bar in javafx

I have a code written using javafx that creates a tableview and then inserts the data given in another file. Im trying to implement a search bar. I want to be able to search the table in the gui and have the matches show up. Any direction? Edit: i understand this question was broad, i wasn’t expecting a…

JavaFX invoking Java methods using JavaScript

My application is completely styled in a web document form (HTML, CSS & JavaScript), and I’m only using JavaFX WebView to load it as a normal resource. I would like to invoke a method from one of my classes (a Java code) using JavaScript. Like for example, a simple Hello World to the console: How ca…

Javafx like Callback but without return

I’m looking for a standard Javafx or java interface (if it exists) that acts like a Callback, except that it does not return a value. The standard Callback from javafx.util package is as follows: This is useful when you need to return the value, but I don’t. I’ve looked into Callable<T&gt…

Retrieve mouse position in JavaFX without event

I want to retrieve the x and y coordinates of the current mouse position before showing a stage. So far, the only way I found to get the mouse position in JavaFX is within a MouseEvent, which does not apply to my situation. Furthermore, I found the possibility to retrieve the position via java.awt.MouseInfo. …

Square GridPane of square cells

My goal is to create a GridView that is resizable, always square and contains an equal number of rows and columns, making their cells also square, similar to a Reversi or Chess board. Here’s a small illustration, the grid is centered horizontally on the content pane. I’ve tried a multitude of diff…

Performance of JavaFx Gui vs Swing

I wrote two simple programs, both draw the same Sierpinski Triangle: One program was implemented using swing, and one using javafx. There is a very significant performance difference, swing implementation being consistently much faster: (In this test case : Swing over 1 sec. Javafx over 12 seconds) Is it to b…

JavaFX Image (class) and ImageView with a URL

I know how to use Image with a url there was a good example here https://stackoverflow.com/a/24934324/7159163 However, when I input a URL into the string it doesn’t work although the Javadocs say if it not a URL it will try to find the file. But it is a URL and its just not displaying. All that has been…