fxml

JavaFX - loading FXML file error

心已入冬 提交于 2019-12-25 02:40:39
问题 I have strange problem which is concerned to loading FXML file using Scene Builder 1.0. I have created a class Warrning and after that I add to my package a FXML file and called it WarrningGUI . Creator has created a Contoller class called WarrningGUIContoller . Until then everything was fine. I stared to create a layout for my application. After I added two raw Panels and turned on and off my FXML file in Scene Builder about 2-3 times something like that appeared: And this was in "Detail":

Java 7 to Java 8 issue with setting background color of TextArea and StyleSheets/css

浪尽此生 提交于 2019-12-25 02:07:05
问题 I had a Java FXML application functioning in Java 7u51 that I built in NetBeans 7.4. I have installed Java 8 and NetBeans 8. I recreated my little application in Java 8/NetBeans 8. Everything is working except some of the css styling. Specifically, I have a Text Area. Here is the Text Area FXML: <TextArea layoutX="1" layoutY="230" minHeight="120" minWidth="320" editable="false" fx:id="eventWindow" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.bottomAnchor="0.0"/> Here is

Inserting images into TableView rows - JavaFX

谁说胖子不能爱 提交于 2019-12-25 01:55:32
问题 Just wondering how to insert an image into cells of a TableView in JavaFX. I have read other peoples solutions on this site but struggle a tad understanding them as I think their set up is a bit different to mine. Pretty much I am making a game library, and in the tableview I want an icon of the game. The data is being read from a .dat file (in which this case a String of the icon's URL), and all the strings in the rows work. The column is made @FXML private TableColumn<Game, Image> iconCol;

How to stop JavaFx Slider controls from resetting to their default values when switching between windows

我的未来我决定 提交于 2019-12-24 20:32:53
问题 I have a bunch of fxml windows that I built in SceneBuilder for javafx. When I switch between my settings window and my main menu the sliders (for various sound levels) reset to their original value, however i would want them to keep the values they were at last time the window was open. I've tried settings values in initialise and settings a variable through the class that is changed and used to set the sliders when it is launched, but that didn't work either. The FXML <!-- The slider code

fxml loader exception “root value is already specified” I never specified a root value

女生的网名这么多〃 提交于 2019-12-24 19:50:18
问题 I am trying to have a hyperlink open a new window. I have copied the fxml loader method from other parts of my code that work without issue. For some reason I am getting an fxml loader exception issue that says the root value is already specified. I have not specified a root value anywhere in my code. I also have not specified a controller in the fxml because other answers on stackoverflow said this might be causing the issue. this is the class that is loading the new Window. the issue occurs

JavaFx optional parameters for controller class in start method when it is loaded into the FXML

跟風遠走 提交于 2019-12-24 19:00:23
问题 with the ScheneBuilder I defined the controller class of my fxml, the code genereted inside my AnchorPane tag is: fx:controller="demo.SplashController" now I would like if I had args in the main, to load a new version of the controller, using the appropriate construct. I try this code in the Application.start: FXMLLoader loader = new FXMLLoader(getClass().getResource("page.fxml")); PageController controller; if(!dir.equals("")){ //attribute coming from args controller = new PageController(dir

Exception in Application start method java.lang.reflect.InvocationTargetException JavaFX image transition

徘徊边缘 提交于 2019-12-24 18:31:25
问题 When i try to add image transition for my JavaFX app, it has thrown this error,I checked the previous questions and answers here in Stackoverflow, but all the solutions were specific for each of those questions only.I am using netbeans IDE. Executing H:\thirdf\FinalF\dist\run2135548605\FinalF.jar using platform C:\Program Files\Java\jdk1.8.0_101\jre/bin/java Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native

JavaFX FXML table; why won't my data display

我的未来我决定 提交于 2019-12-24 14:42:49
问题 I'm trying to create a simple table using FXML. The table displays fine, but it's not displaying my data. Here's my main program. public final class TableTest extends Application { @Override public void start(final Stage primaryStage) { URL fxml = ClassLoader.getSystemClassLoader().getResource("Table.fxml"); FXMLLoader fxmlLoader = new FXMLLoader(fxml); TableController tableController = new TableController(); fxmlLoader.setController(tableController); try { Pane rootPane = (Pane) fxmlLoader

JavaFX 8 Spinner control doesn't update value that's displayed

蹲街弑〆低调 提交于 2019-12-24 14:41:35
问题 I am new to Java programming and opted for developing my tool UI in JavaFX8. I need to have a Spinner (new in JavaFX8u40!) for which the user can specify a integer value from 0 to 120 seconds (the easy part) but also a button which allows the user to set the spinner value directly to the given pre-set button value (here, 0). Trouble is that when I click the button to test it, the spinner value doesn't seem to update and remains at 60 (spinner initial value) or any other value that may have

Why isn't my background image being displayed in FXML

百般思念 提交于 2019-12-24 13:31:29
问题 I decided that I wanted to start learning FXML and the first thing that I wanted to do is create a background Image. I've added background images in javafx before and I thought that the process of adding background images in FXML would what somewhat similar to what you would do in javafx. What am I missing? Here is my FXML File <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.image.*?> <?import javafx.scene.*?> <?import javafx.scene