fxml

JavaFX bad logs - Invocation Target Exception

落花浮王杯 提交于 2019-12-13 21:01:14
问题 Everytime I have an error related to my views (FXML) and controller actions, it ends up showing as a Invocation Target Exception. e.g.: java.lang.reflect.InvocationTargetException file:/C:/Users/Renato%20Correa/Documents/NetBeansProjects/PartyRock/dist/run32339290/PartyRock.jar!/gear7/partyrock/view/IncluirConvidado.fxml at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2186) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2028) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2744) at javafx.fxml

Nullpointer Exception during initialize / FXML injection not working as expected

自作多情 提交于 2019-12-13 20:16:16
问题 I noticed a weird behaviour in one of my controller classes. One of the components is not getting initialized. This is the fxml: <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <AnchorPane id="AnchorPane" prefHeight="500.0" prefWidth="712.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="modulartoolkit.ConfigWindowController">

JavaFX FXML not working same way as in SceneBuilder (sceencast)

非 Y 不嫁゛ 提交于 2019-12-13 18:13:45
问题 I've got this FXML that is working perfectly in SceneBuilder Preview and acts completely different on NetBeans JavaFX Sample Application (so there is nothing extra that could break it's behaviour). (see sceencast) I need that 2 TitledPanes to autoresize (half and half) according with the Window (as it works in the SceneBuilder Preview). <AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="798.0" xmlns:fx="http://javafx

NullPointerException (JavaFX Label.setText())

谁说我不能喝 提交于 2019-12-13 15:49:07
问题 I got problem with my javaFx application. Everytime I call the .setText() method of my Label, I get a NullPointerException. Here is my code: This is a snnippet of my Controller: public class HomenizerController implements Initializable{ //ArrayList zum abspeichern der Termine in Listen Form private ArrayList<Date> dateList = new ArrayList(); //ArrayList zum ab speichern der Aufgaben in Listen Form private ArrayList<ToDo> toDoList = new ArrayList(); private Properties prop = null; @FXML

Netbeans7.1 & JavaFX 2.0 - FXML code completion doesn't work

纵饮孤独 提交于 2019-12-13 12:09:04
问题 I started learning JavaFX 2.0 and installed Netbeans 7.1, java 7.02 SDK (wich contains JavaFX 2). Everything seems to work, the example projects compile and run fine. My problem is: Code completition doesn't work for FXML files. I press ctrl+space and it shows "No suggestions" every time. The same for tags and attributes. Does anyone know what could be the problem? 回答1: You can still show autocomplete menu for attributes by pointing the cursor just beginning (or middle to show sublist) of the

Open a new scene(has its own controller) from another scene(has its own controller)

穿精又带淫゛_ 提交于 2019-12-13 10:27:03
问题 I'm new to JavaFX and still learning I have this problem and couldn't find an answer. I have two FXML files named "one.fxml" and "two.fxml" and they have their own controller classes naming "OneController.java" and "TwoController.java" I'm want to open a "two.fxml" with onButtonClick from "one.fxml". The Button Code in "one.fxml" is: <Button fx:id="clearButton" layoutX="690.0" layoutY="309.0" minHeight="18.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="196.0" text="Clear" onAction="

JavaFX read and save GUI elements

与世无争的帅哥 提交于 2019-12-13 08:28:31
问题 How can I read and save the JavaFX GUI element hierarchy of my program inside a tree (including the main window, Stage , Button , TextBox , etc.)? 回答1: There's no automatism for what you want to achieve. The closest thing to loading is to use an fxml. But the problem is the saving. You can't generate an fxml from your scene nodes. Moreover the fxml is dynamic, it doesn't even have a schema. For the saving you could use JAXB in order to generate a hierarchical XML (i. e. the fxml) implement

Creating a scene using both FXML and the Controller in JavaFX

大城市里の小女人 提交于 2019-12-13 08:17:23
问题 I've created a 9x9 GridPane in SceneBuilder, and I want to add individual TextFields to each cell. I'm certain there are other methods for creating a large table like this, but I'm not looking for a different way to do this (this is part of my learning experience). I don't want to add TextFields in FXML/SceneBuilder; I want to keep track of them in an array so I can access their individual values, so I want to create them one at a time in the Controller and then add them to the array as well

Javafx Dynamically load ComboBox

强颜欢笑 提交于 2019-12-13 07:38:38
问题 I am trying to make a custom builder proposed in Dan Nicks's comment to this question. The idea is to set combo's data before constructing it. The fxml file: <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.ComboBox?> <ComboBox fx:id="combo1" items="${itemLoader.items}" prefWidth="150.0" xmlns:fx="http://javafx.com/fxml/1"> </ComboBox> The class that provides the data: public class ComboLoader { public ObservableList<Item> items; public ComboLoader() { items =

JAVAFX - Load fxml with anchorpane inside main fxml

拜拜、爱过 提交于 2019-12-13 06:18:48
问题 I'm trying to load a fxml file (content area) inside a main fxml. As the code is splited by several files i can't place here all code but if needed i will build a small version with the problem. I only place the relevant parts of code. Main fxml file ... </MenuBar> <AnchorPane fx:id="mainContent" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS" /> <ToolBar prefHeight="25.0" VBox.vgrow="NEVER" /> </children> </VBox> Content fxml (take in attention the anchorpane id) ... <AnchorPane id=