javafx

Two javafx Integer Spinners bound bidirectional: why is the binding unreliable?

旧时模样 提交于 2021-02-20 04:23:10
问题 I am trying to practice my binding. I want to make a window with two spinners and just get them to show the same value. The problem is that the binding is unreliable: the spinners seem to stop updating each other if they are clicked too fast. Both spinners still respond to clicking, and clicks are counted correctly on the spinner being clicked, but the other spinner stops updating and never recovers. And it doesn’t have to be very fast clicking at all to cause it. My code is based on this

How to Judge if a Color is Green?

二次信任 提交于 2021-02-20 02:50:50
问题 What is the formula for deciding if an rgb code is green? Here is an attempt: public boolean isGreen(Color color){ return (color.getGreen() > 0.8*(color.getBlue()) && color.getBlue() > color.getRed()); } That is, return true if the green value of rgb is considerably greater than the blue, and the blue is greater than the red. A test was conducted on its accuracy. Methods: A JavaFX program generated 132 orbs every 6 seconds, each with an rgba (alpha is irrelevant in this case) value of (Math

How to fix UnsatisfiedLinkError?

拟墨画扇 提交于 2021-02-20 00:23:10
问题 I wish to use one of my local sound files to provide background music, but I get this error message: Caused by: java.lang.UnsatisfiedLinkError: Can't load library: C:\Program Files\Amazon Corretto\jdk1.8.0_232\jre\bin\glib-lite.dll But my code is as follow: public class DungeonGUI extends Application { private Dungeon dungeon; private Stage stage; private GridPane root; private Button attack; private Button heal; // private Button checkInventory; private Button save; private Text

How to fix UnsatisfiedLinkError?

余生长醉 提交于 2021-02-20 00:13:22
问题 I wish to use one of my local sound files to provide background music, but I get this error message: Caused by: java.lang.UnsatisfiedLinkError: Can't load library: C:\Program Files\Amazon Corretto\jdk1.8.0_232\jre\bin\glib-lite.dll But my code is as follow: public class DungeonGUI extends Application { private Dungeon dungeon; private Stage stage; private GridPane root; private Button attack; private Button heal; // private Button checkInventory; private Button save; private Text

How to disable a table cell for editing in JavaFX 2

情到浓时终转凉″ 提交于 2021-02-19 07:42:08
问题 In JavaFX 2, I want to disable a some cells in a column for edition. Something along the lines of TableModel.isCellEditable(row, col) in Swing. I need the item in the row to make a decision whether the cell is editable, cell value is not enough. The code I managed to write is: TableView<FilterItem> localTableView = new TableView<FilterItem>() { public void edit(int paramInt, TableColumn<FilterItem, ?> paramTableColumn) { if (paramInt >= 0) { FilterItem item = getItems().get(paramInt); //get

How to generate executable jar in JavaFX with maven project

那年仲夏 提交于 2021-02-19 06:13:38
问题 I can't run generated jar file. Here's my error output: no main manifest attribute, in myapp.jar Here is my pom.xml file: <plugins> <plugin> <groupId>org.openjfx</groupId> <artifactId>javafx-maven-plugin</artifactId> <version>0.0.4</version> <configuration> <mainClass>Main</mainClass> <executable>/Library/Java/JavaVirtualMachines/adoptopenjdk-12.0.2.jdk/Contents/Home/bin</executable> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler

JavaFX Preloader and Netbeans

我的梦境 提交于 2021-02-19 05:37:33
问题 I am using the standard JavaFX preloader templete. But I am not sure how to link it to my JavaFX program. public class FXPreloader extends Preloader { ProgressBar bar; Stage stage; ....... } And here is my Main public class CIDCV extends Application { @Override public void start(Stage primaryStage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("Main.fxml")); Controller.stage=primaryStage; Scene scene = new Scene(root); Controller.stage.setScene(scene); Controller

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

Why do I have java.lang.ClassNotFoundException while trying to run JavaFx application?

大憨熊 提交于 2021-02-19 05:32:58
问题 I have tried to create example application as described here and the code is this: package colorfulcircles; import javafx.animation.KeyFrame; import javafx.animation.KeyValue; import javafx.animation.Timeline; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.effect.BlendMode; import javafx.scene.effect.BoxBlur; import javafx.scene.paint.Color; import javafx.scene.paint.CycleMethod; import javafx.scene

3D surface JavaFX

时光毁灭记忆、已成空白 提交于 2021-02-19 05:32:25
问题 I am trying to implement my own 3D surface animation in JavaFX but i do not understand everything like it should works, could someone help me with understanding which should go where ? Already know that to build Mesh by using class need class object TraingleMesh and then have to add points by using method mesh.getPoints.addAll(...); but.. my Function<Double, Double> after using apply method does not help me at all, cuz the first argument has to be array float type, not double variable after