fxml

JAVAFX - FXML - Access Loaded FXML Controls from Parent Controller

僤鯓⒐⒋嵵緔 提交于 2019-12-13 06:12:18
问题 Here is what I am trying to accomplish. /Package A/ /Package A/ApplicationController.java /Package A/Application.fxml In my Application.fxml file I have a button, and when that button is clicked it loads the following "MyGrid.fxml" file. /Package B/ /Package B/MyGrid.fxml (has a label #mygridlabelid The code I am using is: ContentPane.getChildren().add((Node)FXMLLoader.load(getClass().getResource("/Package B/MyGrid.fxml"))); But the problem is.. even though I am loading the MyGrid.fxml file

How to maintain GridPane's fixed-size after adding elemnts dynamically

你离开我真会死。 提交于 2019-12-13 05:19:28
问题 I need to create board game that can be dynamically change. Its size can be 5x5, 6x6, 7x7 or 8x8. I am jusing JavaFX with NetBeans and Scene builder for the GUI. When the user choose board size greater than 5x5 this is what happens: This is the template on the scene builder before adding cells dynamically: To every cell in the GridPane I am adding StackPane + label of the cell number: @FXML GridPane boardGame; public void CreateBoard() { int boardSize = m_Engine.GetBoard().GetBoardSize(); int

FXML ClassNotFoundException

三世轮回 提交于 2019-12-13 04:57:39
问题 Error C:\Users\rbenedict\Documents\Java Modules>java -cp .;fxmltut fxmltut.FXMLEx Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unk nown Source) at

JafaFx Load FXML file Error Null Pointer Exception

天涯浪子 提交于 2019-12-13 04:47:03
问题 i have this Exception whith no difinition of the error when i am trying to load a window from a button login. before it worked fine, but now i dont know why it shoing this error java.lang.NullPointerException, there is only this line in the console , so i couldnt find whats wrong. hears my files . <SplitPane dividerPositions="0.5" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" orientation="VERTICAL" prefHeight="400.0" prefWidth="600.0" xmlns="http:/

Can't fill Table with items with javafx

爷,独闯天下 提交于 2019-12-13 04:46:00
问题 I'm not so good at javafx and also in English^^. I programmed a TableView but I don't know why it doesn't fill the Table with the Items I created. Perhaps it fills the Table, but I don't see them. I hope somebody could help me here out. Here is the Code: private final TableView<VerzeichnisDaten> table = new TableView(); private final ObservableList<VerzeichnisDaten> data = FXCollections.observableArrayList(); TableColumn titleCol = new TableColumn("Titel"); TableColumn lastNameCol = new

How to switch the root from controllers without resizing the window in JavaFX?

﹥>﹥吖頭↗ 提交于 2019-12-13 04:13:31
问题 (James_D has showed me the solution. I'll just elaborate on how it helped me and what I did at the end of this question. Hopefully others find it useful.) My wrong initial approach: There are several FXML files and their controllers in my program. I loaded the FXML files and changed the scenes. It caused the window size to change when it was maximized. Then this answer showed that I should change the root instead. Current approach and question: I tried the code given in the answer there and

Tabpane in HBox inside Anchorpane not resizing on maximising window

ぐ巨炮叔叔 提交于 2019-12-13 03:52:15
问题 I am new to fxml and scene builder, and working on to design a GUI to send Post request. I have placed two tab-panes in an HBox inside an anchor-pane. The left tab-pane contains two tabs head and body for request and the right tab-pane contains the response head and body. On maximising the window, I see both the tab-panes are getting collapsed. I tried to set anchor pane layout for both the HBox, but that is not working. <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control

FXML Custom Chart

只愿长相守 提交于 2019-12-13 02:56:10
问题 I've been using custom fitting chart from Ensemble Test, which works great. Problem is I cannot use it in FXML. Someone else seemed to do that successfully. Error: Instances of curvefittedareachartappfxml.CurvedFittedAreaChart cannot be created by FXML Loader. FXMLDocument.fxml <?import javafx.scene.chart.*?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import curvefittedareachartappfxml

JavaFx CheckBoxTreeItem<Path> selecting root item error

若如初见. 提交于 2019-12-13 02:48:28
问题 I'm trying to develop a file copy application. I've created a checkbox tree item with current directories on file system. But when I select first node (c:/ directory), it takes a long time. How can I select all directories easily and quickly? Here is my first FXML load class: @Override public void initialize(URL location, ResourceBundle resources) { TreeView pathTree = new MyFileTreeView().getMyFilePathTree(); vBoxFileTree.getChildren().add(pathTree); } This is my treeView component: public

Javafx: Open a new FXML from another Java Class

萝らか妹 提交于 2019-12-13 02:32:58
问题 I have a JavaFx application with following files: MainApp.java - Java class responsible for handling the application Controller.java - Corresponding controller file Design.fxml - FXML file for the application which is loaded via MainApp.java and controlled by Controller.java Now, let's say I have another class file as Compute.java which has a method (say doSomething()). When this method terminates, I wish to open a built-in Alert box or a custom FXML file on top of the original FXML file (say