fxml

Javafx: Reusable collections using FXML

霸气de小男生 提交于 2019-12-10 11:37:52
问题 I'd like to bind a single collection to multiple ChoiceBox's in FXML. However the only way I know how is using: <ChoiceBox fx:id="cb00" prefWidth="150.0" GridPane.rowIndex="0" GridPane.columnIndex="0"> <items> <FXCollections fx:id="test" fx:factory="observableArrayList"> <String fx:value="1" /> <String fx:value="2" /> <String fx:value="3" /> <String fx:value="4" /> <String fx:value="5" /> <String fx:value="6" /> <String fx:value="7" /> <String fx:value="8" /> <String fx:value="9" /> <

javafx2.0 - force refresh the scene

自闭症网瘾萝莉.ら 提交于 2019-12-10 11:25:22
问题 In my app, one scene having the popup dialog which consists of some fields and buttons. If you click on the button then I want to dismiss the popup dialog as well as update the some fields in the scene. Indirectly I want to refresh scene. is it possible? I used the following code.Here what I did is, I get the controller of that scene and then update the field using id. but it doesn't work. URL location = AdmincontrolController.class.getResource("admincontrol.fxml"); FXMLLoader fxmlLoader =

Styling button in javaFX using CSS

僤鯓⒐⒋嵵緔 提交于 2019-12-10 10:44:05
问题 I have a problem with styling button in javaFX using CSS. I use Intellij Idea IDE. I have CSS.css file : #Button { -fx-padding: 8 15 15 15; -fx-background-insets: 0,0 0 5 0, 0 0 6 0, 0 0 7 0; -fx-background-radius: 8; -fx-background-color: linear-gradient(from 0% 93% to 0% 100%, #a34313 0%, #903b12 100%), #9d4024, #d86e3a, radial-gradient(center 50% 50%, radius 100%, #d86e3a, #c54e2c); -fx-effect: dropshadow( gaussian , rgba(0,0,0,0.75) , 4,0,0,1 ); -fx-font-weight: bold; -fx-font-size: 1.1em

Should we use FXML in JavaFX custom controls or not?

£可爱£侵袭症+ 提交于 2019-12-10 03:16:54
问题 It seems wired to ask this, I would think that using FXML to write our custom components is the obviously the right way to go. But as we can see from ControlsFX, JFXextras and even the book 'Mastering JavaFX8 controls do not use or mention the use of FXML in custom controls. Despite that, the official documentation to say to go on that route, and create JavaFX controls via FXML. What is the more correct way and why ? 回答1: There are two kinds of custom controls in JavaFX: fx:root based custom

Refill a SVG Path with onMouseEntered event in JavaFX

二次信任 提交于 2019-12-10 00:20:03
问题 i'm working on a personal project which includes a .fxml document(created from a .svg file with NetBeans). Here is the Map as you can see.Moreover, all the regions are converted into a SVG Path in .fxml file. The thing is i can handle with mouse events with using JavaFX Scene Builder with a controller class however, i want to refill (or in other words repaint or highlight ) the region whenever mouse is entered on it. Here is main class public class JavaFXApplication1 extends Application {

JAVA FXCollections LoadException Class is not a valid type

一个人想着一个人 提交于 2019-12-09 17:28:12
问题 I'm trying to implement a TableView with some data with the help of this Tutorial. Im stuck on populating data from my "Person.java" to the TableView. I tracked the problem down to the part <Person firstName="Jacob" lastName="Smith" email="jacob.smith@example.com" /> inside the "fxmltableview.fxml" file at the very bottom. So it seems that for some reason my "observableArrayList" isn't allwed to contain "Person.java" objects. "String.java" is allowed. Im out of ideas for experementing with

JavaFX 2.0 FXML Child Windows

一世执手 提交于 2019-12-09 13:46:23
问题 After much searching I found this question How to create a javafx 2.0 application MDI. What I really wanted to know is if I can create a pop-up window or child window to the main window using JavaFX components and Scene Builder to create the new window. I ended up with this for a modal pop-up window: In the Main class I wanted to save the primary stage to a field I can access from my primary controller class. So, I added a static variable Stage to it and this in the Main.Start() method:

Is there a way to modularize a JavaFX application?

爷,独闯天下 提交于 2019-12-09 13:16:15
问题 I've started toying with JavaFX 2 and I really like the ease with which one can create a UI with FXML. However, once you get past the basic examples and you need a UI with many windows, it seems illogical to have the definition for the whole application's UI in a single FXML file. Is it possible to write separate components in separate FXML files and then include them as needed? Say for example that I wanted a window to popup when the user clicks on an item from the main menu; could I write

JavaFX screen resolution scaling

时光怂恿深爱的人放手 提交于 2019-12-09 09:25:38
问题 I have been searching for a method to do this, but I only found This question without answers. I am developing in a 1366x768 laptop, I use JavaFX to create a GUI (I am sorry, but I can't post the code, it's basically an AnchorPane containing a couple GridPanes, which contain more GridPanes, which contain Labels, TextFields and a couple Charts). The problem comes when I load the project on another resolution (1920x1080 or 1600x900). I am using stage.setMaximized(true); , but this only Scales

How to Convert FXML to JAVA

♀尐吖头ヾ 提交于 2019-12-09 03:39:01
问题 I were created a fxml file using javafx scene builder in netbeans. How do i convert .fxml file in netbeans to .java? Is that any program to convert it? I am not very good in fxml so I want to use .java file to code my javafx app. Please help me. Thank 回答1: There isn't any support for this kind of thing. The idea is that you are using FXML to visually layout your UI and then connecting it to java using a controller class. Sidenote: We at e(fx)clipse started a build addon that allows you to