Questions tagged [fxmlloader]

310 questions
1
vote
0 answers

JavaFx Call another panel and transmits values

My program is structured package and control on the interface as follows **+ Browser : BrowserController.class** -@FXML private SplitPane spHTMLParser; @FXML …
Touya Akira
  • 301
  • 4
  • 14
1
vote
2 answers

How can I reference the same FXML element from an instance of the same class

Sorry I am new to JavaFX. My setup: I have one main FXML GUI which is displayed the entire time. Inside this main GUI I have loaded another FXML in an AnchorPane. The second FXML is loaded into this AnchorPane (which is in the main GUI) initially…
lolftw
  • 35
  • 7
1
vote
0 answers

Importing FXML vs using FXMLLoader

I have 2 views: a main, and a subpane; and 2 respective controllers, each defined by an FXML file. A button pressed in main should result in an action in the subpane. Currently, I'm simply importing the subpane's fxml into the main one like…
buggaby
  • 359
  • 2
  • 13
1
vote
0 answers

Is it possible to create bindings to javafx.beans.property.ListProperty properties in fxml?

I am trying to separate all relations between ui-elements (i.e. "disable button if textfield is empty") to fxml. This works fine in most cases, but it seems to be impossible to bind to java.util.List derived classes. It always ends in…
Woodrow
  • 11
  • 2
1
vote
1 answer

FXMLLoader cannot find running controller instance and creates new one

I'm a newcomer when it comes to JavaFX and I recently encountered a problem which really confuses me alot. I'm using a class called "MainController" which controlls an FXML-File containing a TabPane. Each tab is controlled by another controller. But…
Geta92
  • 13
  • 3
1
vote
1 answer

LoadException: Root value already specified on custom control

Example below causes javafx.fxml.LoadException: Root value already specified. The code is written according to example here: http://docs.oracle.com/javafx/2/fxml_get_started/custom_control.htm Code: public class NavigationView extends ButtonBar { …
Dims
  • 47,675
  • 117
  • 331
  • 600
1
vote
3 answers

Load fxml as background process - Javafx

My initial fxml(say home.fxml) has a lot of functionalities, hence it takes a lot of time to load completely. So to avoid the time gap between program start and fxml loading I introduced one more fxml(say loader.fxml) with a gif image which should…
Harshita Sethi
  • 2,035
  • 3
  • 24
  • 46
1
vote
1 answer

FXMLLoader template flag

Looking at FXMLLoader#load, a "template flag" is mentioned - yet I see no explanation of how to set this flag. Presumably there should be a FXMLLoader#setTemplate, but no such method exists in the linked JavaDoc, and using the latest 1.8 OpenJDK…
Itai
  • 6,641
  • 6
  • 27
  • 51
1
vote
1 answer

Java FXML resource FXMLDocument.fxml

public class Clearance extends Application { @Override public void start(Stage stage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml")); Scene scene = new Scene(root); …
JR Galia
  • 17,229
  • 19
  • 92
  • 144
1
vote
1 answer

How can I preserve new line characters in the creation of TextFlow dynamically with FXML and JavaFX

The following code dynamically creates a TextFlow and Text that originally has new line characters in it (potentially images and other panes). InputStream stream = new ByteArrayInputStream(text.toString().getBytes(StandardCharsets.UTF_8)); …
Daniel Gerson
  • 2,159
  • 1
  • 19
  • 29
1
vote
0 answers

JavaFX : Root value already specified

I want to change the center of borderpane when I click a menu but it pops up an error "Root value already specified.". At first, I initialize it like below @Override public void initialize(URL url, ResourceBundle rb) { // TODO …
James
  • 305
  • 8
  • 19
1
vote
1 answer

JavaFX Controller loading

I came across some very strange behaviour a couple of times every time forgetting the trick. FXMLLoader loader = new FXMLLoader(); loader.setLocation(getClass().getResource("view/window.fxml")); Parent root = loader.load(); GuiController controller…
ZbyszekKr
  • 512
  • 4
  • 15
1
vote
0 answers

How do I load an fxml file from a sub directory of the parent directory of my controller class

I currently have an application with the following packages: com.javafx.sea.controller, contains my controller class for the application com.javafx.sea.view, contains all the fxml files for the interface. What i want to do is a load a different…
Jeremiah
  • 11
  • 2
1
vote
2 answers

Call a javafx fxml controller method from another class to update a tableview

I am trying to update a javafx tableview defined in my fxml controller by calling a particular method FXMLDocumentController.onAddSystemMessage() from another application utility class method GlobalConfig.addSystemMessage(). Here is my main…
thanili
  • 777
  • 4
  • 26
  • 57
1
vote
3 answers

JavaFX: Empty window is displayed on first attempt

Preface: Newbie into Javafxml My application is working perfectly. I just have one issue that I know should have a very simple solution, but I can't come up with anything more. When i run my application, i get an empty window. Empty Window I have…
user2851347
  • 91
  • 1
  • 12