fxmlloader

Switch between fxml files

╄→гoц情女王★ 提交于 2019-12-20 07:28:53
问题 I have created an application using jfxPanel inside swing component. The problem I am facing is I am not being able to change the fxml files. When a button of the fxml is clicked, I want to dispose that fxml and load another fxml file there. This is what I have done till now public class NonResponsiveButtons extends JFrame { NonResponsiveButtons nrb; BottomPanelIncomingController bpic; JPanel panel; JPanel bPanel; private int applicationWidth_600 = 600; private int applicationHeight_600 = 600

Is @FXML needed for every declaration?

余生长醉 提交于 2019-12-16 22:24:28
问题 Is @FXML needed for every declaration or just for the first? In other words, should I use @FXML public Label timerLabel = new Label(); @FXML public TextField mainTextField, projectTextField ; @FXML public Button goButton, deleteAllButton ; @FXML public ComboBox<String> projectComboBox ; @FXML public TableView<Entry> mainTable ; @FXML public TableColumn<Entry, String> titleColumn, timeColumn, dateColumn ; @FXML public TableColumn<Entry, Boolean> checkColumn, buttonColumn ; @FXML public

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:/

JavaFX change Pane color from a different class

妖精的绣舞 提交于 2019-12-12 04:57:12
问题 I have a question. I want to change the color of a pane from another controller class. I am using this code: FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/Menu.fxml")); try { Parent loaded = (Parent) loader.load(); } catch (IOException e) { e.printStackTrace(); } MenuController controller = (MenuController) loader.getController(); Platform.runLater(new Runnable() { @Override public void run() { Pane pane = controller.getRedPane(); pane.setBackground(new Background(new

Error in Loading FXML file into Anchor Pane in JavaFX

ぃ、小莉子 提交于 2019-12-12 04:39:56
问题 My currently developing program has one menu and one Anchor Pane to show content according to the selected menu item.In my program,I want to load my fxml file into content anchor pane which is again inside the main fxml file when user clicks menu item form menu bar.I have built anchor pane in main.fxml. <AnchorPane id="main_panel" layoutY="28.0" prefHeight="700.0" prefWidth="670.0" /> I have built that method in controller class for Main.fxml.DashBoard.fxml and controller class for DashBoard

To use or not to use java FXML builders

允我心安 提交于 2019-12-12 03:16:53
问题 We have started to use the java FX with FXML for a desktop application. We need to load some combos with values from a local cache and we created a builder that instantiate the combo, fill it with values from cache and return it. We expect to have around 20 builders. I know most of java FX builders are deprecated because of this http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-March/006725.html According to a FXML tutorial if the FXMLLoader cannot create an object of a class, it looks

NullPointer location on JavaFX FXMLLoader

一个人想着一个人 提交于 2019-12-12 02:59:12
问题 I've read through all of the issues about this on stackoverflow, and I haven't used something that worked. I have a basic fxml that is built using the JavaFX Scene Builder 1.1 while using Java 1.7. I just want to load the file... but everything seems to point to a null location meaning that it cant find it. I don't understand why. I have 18 try/catches to show 18 different possibilities for it to work under, but it cant find it. These examples are pulled from some of the stackoverflow

NullPointerException loading fxml file from javafx applet

你说的曾经没有我的故事 提交于 2019-12-12 02:56:24
问题 I'm trying to create javafx applet, using IntelliJ Idea. After building I get three files: .jar, .jnlp and .html. If I launch jar all works fine, but if I try to run app using jnlp or html it throws exception: java.lang.NullPointerException: Location is required. at javafx.fxml.FXMLLoader.loadImpl(Unknown Source) at javafx.fxml.FXMLLoader.loadImpl(Unknown Source) at javafx.fxml.FXMLLoader.loadImpl(Unknown Source) at javafx.fxml.FXMLLoader.loadImpl(Unknown Source) at javafx.fxml.FXMLLoader

JavaFX. FXML loader can't find .fxml file in the project with modules

这一生的挚爱 提交于 2019-12-11 17:22:25
问题 I have a project with such structure: I trying to load sample.fxml from the Main class using this code: Parent root = FXMLLoader.load(Main.class.getResource("../../submodule/src/java/sample.fxml")); but it doesn't work. The sample.fxml file code is: <?import javafx.geometry.Insets?> <?import javafx.scene.layout.GridPane?> <?import javafx.scene.control.Button?> <?import javafx.scene.control.Label?> <GridPane fx:controller="sample.Controller" xmlns:fx="http://javafx.com/fxml" alignment="center"

JavaFX FXMLLoader InvocationTargetException?

亡梦爱人 提交于 2019-12-11 15:48:28
问题 I am trying to update some components situated in other Controller using FXMLLoader, When i run my code i get this exception : Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774) at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86