Change JavaFx Tab default Look

You should also override the CSS: .tab-pane:top *.tab-header-area { -fx-background-insets: 0, 0 0 1 0; /* -fx-padding: 0.416667em 0.166667em 0.0em 0.833em; /* 5 2 0 10 */ -fx-padding: 0.416667em 0.166667em 0.0em 0.0em; /* overridden as 5 2 0 0 */ } Here the left padding value of the tab-header-area changed from 10 to 0. In … Read more

JavaFX: Get Node by row and column

I don’t see any direct API to get node by row column index, but you can use getChildren API from Pane, and getRowIndex(Node child) and getColumnIndex(Node child) from GridPane //Gets the list of children of this Parent. public ObservableList<Node> getChildren() //Returns the child’s column index constraint if set public static java.lang.Integer getColumnIndex(Node child) //Returns the … Read more

JavaFX: Undecorated Window

I don’t get your motivation for preliminary calling the start()-method setting a stage as undecorated, but the following piece of code should do what you want to achieve. package decorationtest; import javafx.application.Application; import javafx.stage.StageStyle; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Stage; public class DecorationTest extends Application { public static void main(String[] args) { Application.launch(args); } @Override … Read more

Manually typing in text in JavaFX Spinner is not updating the value (unless user presses ENTER)

Unfortunately, Spinner doesn’t behave as expected: in most OS, it should commit the edited value on focus lost. Even more unfortunate, it doesn’t provide any configuration option to easily make it behave as expected. So we have to manually commit the value in a listener to the focusedProperty. On the bright side, Spinner already has … Read more

JavaFX TabPane – One controller for each tab

One approach is to encapsulate each of your tab pages into a separate FXML file with it’s own associated controller class. Then in your FXML file for the main tab control you can do something like this: <TabPane fx:controller=”com.foo.MainController”> <tabs> <Tab text=”Untitled Tab 1″> <content> <fx:include fx:id=”fooTabPage” source=”fooTabPage.fxml”/> </content> </Tab> <Tab text=”Untitled Tab 2″> <content> … Read more

JavaFx Drag and Drop a file INTO a program

Here is a simple drag and drop example that just sets the file name and location. Drag files to it and it shows their name and location. Once you know that it should be a completely separate matter to actually play the file. It is primarily taken from Oracle’s documentation: https://docs.oracle.com/javafx/2/drag_drop/jfxpub-drag_drop.htm A minimal implementation needs … Read more

JavaFX WARNING: Unsupported JavaFX configuration: classes were loaded from ‘unnamed module @…’

TL;DR: Make sure JavaFX is resolved as named modules. Non-modular application: java –module-path <path-to-fx> –add-modules <fx-modules> … Modular application: java –module-path <path> –module <main-module>/<main-class> [args…] Where <path> includes your module as well as JavaFX. Use JDK distribution which includes JavaFX (see answer below for more information). May still need to use –add-modules. Background This warning … Read more

SVG Image in JavaFX 2.2

Is there any way to display an SVG image in an JavaFX application? Here are some options: Create a WebView and load the svg image into the WebView’s WebEngine. The e(fx)clipse project includes an svg to fxml converter (link now dead :(). This NetBeans plugin also converts svg to fxml (link now dead :(). You … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)