fxml

How to read data from Excel in JavaFX application?

女生的网名这么多〃 提交于 2020-02-25 10:15:34
问题 I am creating a JavaFX FXMl application with hibernate as ORM in Java. I want to read data from Excel and store it to MySQL using hibernate, but it fails to create Workbook. I have spend hours to read tutorials and other posts whether in SO or other sites, neither accepted answers nor comments helped me. In my Form_Main.fxml file I have a button that calls related method to read data from Excel. I have added following JAR files: * poi-4.1.0 * poi-ooxml-4.1.0 * poi-ooxml-schemas-4.1.0 *

JavaFX: 2 independent windows at once

不问归期 提交于 2020-02-25 04:07:31
问题 I'd like to create 2 independent windows at once. One window would be able to hold an observable list, the other one would show the selected listobject's properties. I'm trying to create the listview as a generic list, and combine it with an object specific window (eg. customer properties, beer properties, store properties). In short: if the user clicks 'Customers', it shows the listview with all the customers, and the first customer's properties are shown in a seperate, customer-specific

JavaFX: 2 independent windows at once

岁酱吖の 提交于 2020-02-25 04:07:05
问题 I'd like to create 2 independent windows at once. One window would be able to hold an observable list, the other one would show the selected listobject's properties. I'm trying to create the listview as a generic list, and combine it with an object specific window (eg. customer properties, beer properties, store properties). In short: if the user clicks 'Customers', it shows the listview with all the customers, and the first customer's properties are shown in a seperate, customer-specific

Transparent stage/scene loses its transparency after loading another FXML file

亡梦爱人 提交于 2020-02-07 15:45:12
问题 When I start my application my transparent javafx.stage.Stage shows a half transparent image as expected. But after a second stage is loaded the first stage loses its transparency. The weird thing is that if the second fxml file ("MainScreen.fxml") doesn't contains any components like buttons or text fields, the background stays transparent. I'm using JavaFX with JavaSE-1.8 in eclipse neon.2 on macOS Sierra. Main class package customPackage.main; import javafx.animation.FadeTransition; import

ListView styling in JavaFX

烂漫一生 提交于 2020-02-02 03:14:06
问题 I have a listview. I want to change the color of the background and the text fill. I have tried doing the following: playlistView.setStyle("-fx-background-color: blue; -fx-text-fill: black;"); But, this doesn't work. However, the following is working: playlistView.setStyle("-fx-font-size: 24px; -fx-font-family: 'SketchFlow Print';"); Can you please tell me how to get the background and text-fill to work? Thank you. 回答1: You can use the following CSS styles: .list-view .list-cell:even { -fx

Java FXML load (Dynamic) from absolute path

孤街醉人 提交于 2020-02-01 07:35:51
问题 I want to load fxml files from an absolute path or a path outside of my jar system. background: it will be a simple plugin-system that look's in the plugin folder for all fxml files (later jar files) and include it automatically in a TabPane. String fxmlpath = "C:\\plugin\\pluginfxml.fxml"; try { Parent root = FXMLLoader.load(getClass().getResource(fxmlpath)); //Load root in Tabpane and so on ... } 回答1: It should be simple: Parent root = FXMLLoader.load(Paths.get(fxmlpath).toUri().toURL());

Java FXML load (Dynamic) from absolute path

一世执手 提交于 2020-02-01 07:35:13
问题 I want to load fxml files from an absolute path or a path outside of my jar system. background: it will be a simple plugin-system that look's in the plugin folder for all fxml files (later jar files) and include it automatically in a TabPane. String fxmlpath = "C:\\plugin\\pluginfxml.fxml"; try { Parent root = FXMLLoader.load(getClass().getResource(fxmlpath)); //Load root in Tabpane and so on ... } 回答1: It should be simple: Parent root = FXMLLoader.load(Paths.get(fxmlpath).toUri().toURL());

JavaFx elements, change the size dynamically in relationship to the size of the window

夙愿已清 提交于 2020-01-30 08:38:27
问题 I have this: A borderPane with left node a Vbox (green arrow) with button inside(orange arrow). What I can not do is find a way to change the dimensions of Vbox(green segment) and then for the button (orange segment) in accordance with the size of the window. (when the user plays with the window size) I prefer to find a way to set the parameters into my css files, or as a last resort inside my fxml. .css file: .left-borderPane{ /*this is style class for Vbox */ /*something so similar: */ -fx

JavaFX Load Exception

白昼怎懂夜的黑 提交于 2020-01-25 04:26:32
问题 I'm trying to make a basic calculator application with JavaFX but I'm having trouble launching the application. This is the error I get Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java

How to change sub fxml gui parts at runtime with Button Click

試著忘記壹切 提交于 2020-01-22 05:19:05
问题 I'm tryin to build a skeleton for a big complex gui, so the idea is to make everything with mvc like style in javafx 2.1, so every component has a fxml file and if needed css,controller and model. I'm tryin to figure out how to change sub scenes(sub fxml at runtime). Anybody know how to do it? I'm kinda stuck on this. May bee to add MainViewController? scenario: user clicks on button in taskbar and the included content1.fxml will be replaced with content2.fxml here the basic code MainApp.java