How can I open a JavaFX Maven project from scratch in IntelliJ IDEA? As there is no difference between a Java project and a JavaFx project, I want to open a dedicated JavaFX project (Selection JavaFX from create project Wizard) with Maven module included. Answer Although dated I’m answering this because I had the same question recently and too many
Tag: javafx
How to create an FXML file for an already created new component in java than add it to scene builder?
I’m new to javaFX. I created a customized Search box (extends TextField) in java, check image: I tested it with a test class and it’s working. I want to know now if it’s possible to create its FXML file than add this component to scene builder ? how to do it ? Thanks in advance. Answer How to Import a
Set the first day of the week in JavaFX’s DatePicker
Is it possible to change the first day of week on JavaFX’s DatePicker when applying Arabic locale? I need to change it from Saturday to Sunday. Answer I was able to change the first date of the week by injecting the following class within my application: Do not forget to change the default locale: EDIT: The previous solution does not
JavaFx equivalent of Swing JFrame
I am learning JavaFX. I have encountered a problem; I cannot figure out what is the equivalent of a Swing JFrame in JavaFX. Is it the Scene or the Stage? Answer The equivalent of a Swing JFrame in JavaFX is the Stage class which extends from Window and can be made visible by calling show() method. The Scene is more
How to hide TableView column header in JavaFX 8?
I need to have an observable list of a type that will be displayed in a TableView with one single column, that when selected will display the rest of its information on the right. The TableView is wrapped in a TitledPane, which is wrapped in an Accordion. See image below: As you can see in this scenario I don’t want
How do I put something on an FX thread?
I’m new to JavaFX (trying to move from Swing), and am trying to make a very basic window first. However, I keep getting the following runtime exception: However, looking at the JFXPanel source code, the constructor calls its initFX() method, which initializes the FX application thread. Why, then, am I getting this error, and how do I fix it? Answer
How to rotate the LinearGradient in a given Shape?
I try to find the way to rotate the LinearGradient object nested into e.g. Rectangle object, say: Now, I try to rotate this lg object, for example for 45 degrees to the left, but without rotating the whole rect. Is there any way to achieve that? Answer The first parameters that are given to the LinearGradient constructor are the coordinates
“No select item” on JavaFX combobox?
What is the correct way to put an item which value is null, inside a ComboBox? I tried using myComboBox.getItems().add(null);, and it works, but whenever the user selects this value on the combo box, an exception is thrown on the console: So i think maybe this is not the correct way of doing that. Any clues? Answer In my experience,
How to right align a button in Java FX toolbar
I am building a UI using Java FX scene builder and I want a button in a toolbar to float towards the right side of the toolbar. I have tried changing the node orientation of the parent(toolbar) and also the button but both seem to be ignored. Answer Add a pane with no content which always grows to fit available
JavaFX Table Cell Editing
I am trying to make a program in Java to manage my bookie accounts. I’m new to java, so I thought I would chose something simple to see how things work. I decided to use a tableview and make the individual cells editable. I’ve been following this tutorial http://java-buddy.blogspot.co.uk/2012/04/javafx-2-editable-tableview.html. It details how to do it using java code, and copying