fxml

Using more than one choicebox to filter listview in JavaFX

白昼怎懂夜的黑 提交于 2021-02-19 05:35:20
问题 I am trying to create a filter function for my listview using multiple choiceboxes and I have no idea how to do it since i'm quite new to JavaFX. I did some research and I hear using a filteredList is required but most of the examples online revolve around only using a textfield. So this is my controller class @FXML private ChoiceBox<String> genre; @FXML private ChoiceBox<String> branch; @FXML private ChoiceBox<String> status; @FXML private ChoiceBox<String> company; @FXML private ListView

JavaFX ImageView via FXML does not work

流过昼夜 提交于 2021-02-08 13:24:06
问题 I have a problem with loading Images with ImageView on FXML. My controller class: public class BoxViewController { @FXML private Label label_boxID; @FXML private ImageView boximage; public void initData(ObservableList<BoxProperty> observableList, BoxService sBox, TableView tableview) { this.label_boxID.setText( String.valueOf(this.boxproperty.getPboxid())); Image image = new Image("boximage.jpg"); this.boximage = new ImageView(); this.boximage.setImage(image); } } So, setting the label with a

How to fix “Unable to derive module descriptor for .jar file” error in fxml

落花浮王杯 提交于 2021-02-08 05:27:14
问题 I would like to get an image from JAR library to my project. <graphic> <ImageView> <Image url="@/toolbarButtonGraphics/general/TipOfTheDay24.gif"/> </ImageView> </graphic> I've added the library to my module and it seemed to be correct but the compiler throws an error: Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for filepath.jar Caused by: java.lang.IllegalArgumentException: jlfgr.1.0: Invalid module name: '1' is not a

IllegalAccessError while using FXMLLoader

浪尽此生 提交于 2021-02-05 09:26:09
问题 I am trying to load an FXML file into my javafx application as my root widget, I am using windows 8.1 with java 11.04 and javafx-sdk 13 with the Eclipse 2019 IDE. I searched a little bit on the internet but did not find anything. my situation is a bit complicated, because javafx is not available on java 11, so I installed it by myself which took a lot of time to figure out how to. This is the code that I am trying to run : package application; import java.io.IOException; import javafx

Dynamically update Combobox after selecting item in another ComboBox - JavaFX

时间秒杀一切 提交于 2021-02-04 20:59:21
问题 I have a JavaFX form with two combo boxes populated with Times in 15 min increments for Start and End times. I am trying to get the End time combo box to dynamically repopulate with options when the user selects a start time so that it is not possible for the user to select an End time before the start time while preserving the user's selection if the user has already selected an end time that is still after the start time. I have been able to get both boxes to populate correctly and

Java FXML Error: Exception in Application start method [duplicate]

浪尽此生 提交于 2021-01-29 19:28:52
问题 This question already has an answer here : How do I determine the correct path for FXML files, CSS files, Images, and other resources needed by my JavaFX Application? (1 answer) Closed 2 months ago . I have created a JavaFX project, and have an error upon running, I suspect the error is within the following main class: import java.io.IOException; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.layout.AnchorPane; import

javafx send back data to previous controller

◇◆丶佛笑我妖孽 提交于 2021-01-29 10:16:31
问题 I have two different controller with two different FXML view. First controller is CashierController,there is button inside to open new scene and with new controller AddProductController. In this cashiercontroller the was cart to initialize to populate the tableview based on cart item. Second, open Addproductcontroller when click that button with new scene while prev cashiercontroller still open.inside AddProductController have the gridpane,when choose any cell inside the gridpane will add the

JavaFX FXML:How to create new instances of a self made fxml to VBox

◇◆丶佛笑我妖孽 提交于 2021-01-29 06:17:04
问题 I created a card like pane so that I can add data to it and create a page with many cards according to data (much like a card layout in mobile applications) however, I don't know how to add new instances of this to VBox. I tired with and without a loop and still didn't work. It Keeps Giving the Following Error: javafx.fxml.LoadException: /C:///////bin/application/HotelReservation.fxml at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601) at javafx.fxml.FXMLLoader.loadImpl

Are default methods recognized by FXML and/or Scene Builder?

给你一囗甜甜゛ 提交于 2021-01-29 04:03:42
问题 Based on my experience the answer to the question in the Title is a resounding 'NO!!!', which I can't believe to be true ... but for my experience. I've created various property type interfaces having 3 methods, for example: getColor(), setColor(Paint c), and ObjectProperty colorProperty(). The get()/set() methods are implemented in the interface with the default modifier. This generally works fine except in cases involving Scene Builder and FXML. With Scene Builder the above property doesn't

Gradient in JavaFX

爷,独闯天下 提交于 2021-01-29 03:59:45
问题 How do I develop a gradient in JavaFX that looks like the one below? 回答1: Use linear-gradient in CSS : linear-gradient(to (top, right, bottom, left) , (color begin) , (color finish) ); -fx-background-color: linear-gradient(to top,-color-amber, transparent); 来源: https://stackoverflow.com/questions/40532924/gradient-in-javafx