javafx

Add custom component to FXML scene builder in intelliJ

瘦欲@ 提交于 2020-01-05 06:54:05
问题 I want to add a custom component / custom components to the javafx scene builder in intelliJ. I'm currently using java 8.1. I heard that adding components to the scene builder is possible with java 10 because it has java 2.0. I have java 10 installed, but I don't know how to switch to that version of java. So if you know how to solve this problem, I'd love to hear it. Thanks in advance, Lenardjee Edit: I see why this problem is simular to other posts, for the direct problem is directly adding

Add custom component to FXML scene builder in intelliJ

百般思念 提交于 2020-01-05 06:53:21
问题 I want to add a custom component / custom components to the javafx scene builder in intelliJ. I'm currently using java 8.1. I heard that adding components to the scene builder is possible with java 10 because it has java 2.0. I have java 10 installed, but I don't know how to switch to that version of java. So if you know how to solve this problem, I'd love to hear it. Thanks in advance, Lenardjee Edit: I see why this problem is simular to other posts, for the direct problem is directly adding

Javafx IO Exception about “implements Serializable”

蹲街弑〆低调 提交于 2020-01-05 06:04:54
问题 I have some trouble on javafx FILE IO. I have implemented Serializable but there is also some wrong. Thank you for your help. 1.Appdata class package data; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import javafx.beans.property.SimpleStringProperty; import javafx.collections.FXCollections; import javafx

How to work around Unrecognized image loader: null in JavaFX?

痴心易碎 提交于 2020-01-05 05:58:57
问题 My application, written in Java 8 using JavaFX, takes screenshots, or rather, snapshots, and twice it generated this error: java.lang.IllegalArgumentException: Unrecognized image loader: null at javafx.scene.image.WritableImage.loadTkImage(WritableImage.java:240) at javafx.scene.image.WritableImage.access$000(WritableImage.java:46) at javafx.scene.image.WritableImage$1.loadTkImage(WritableImage.java:51) at javafx.scene.Scene.doSnapshot(Scene.java:1236) at javafx.scene.Node.doSnapshot(Node

JavaFX coordinate system defaults to YUp

[亡魂溺海] 提交于 2020-01-05 05:50:15
问题 In my JavaFX Application, I use SceneBuilder by Gluon. The preview for the scene has a coordinate system of Y Down (Y increases downwards). However, when I import the fxml file into Java, the coordinates are all flipped. Here are the relevant screenshots. Here is the Java export: And here is the SceneBuilder preview: From what I have gathered from extensive Googling, the JavaFX coordinate system should be Y-Down, not Y-Up. Is there something wrong with my version of JavaFX? I'm on Mac OS X 10

JavaFx connecting two child nodes with a line by dragging and dropping

£可爱£侵袭症+ 提交于 2020-01-05 05:42:06
问题 I have two nodes. I would like to click on one node, drag my cursor across to another node, and connect the two nodes with a line once the cursor is released. I have set up all the EventHandlers -- dragging and dropping the line works, but it doesn't bind to the second node. public class LinkHandler { static Node hoverNode; } This class is used to find what Node the cursor is hovering over. private void setLinkHandlers(Node node) { Line line = new Line(); this.getChildren().add(line); // On

JavaFX 8 filtered ComboBox throws IndexOutOfBoundsException when popup clicked [duplicate]

匆匆过客 提交于 2020-01-05 04:52:49
问题 This question already has answers here : How to avoid ArrayIndexOutOfBoundsException or IndexOutOfBoundsException? [duplicate] (2 answers) Closed 3 years ago . I am running Java 8u102. I have a modal window that contains a Combobox whose items are a FilteredList created from a list of Strings. The ComboBox is editable so that the user can enter text (automatically converted to uppercase). The items in the ComboBox popup are then filtered such that only those items that start with the entered

Queue print jobs in a separate single Thread for JavaFX

主宰稳场 提交于 2020-01-05 04:31:12
问题 currently I am experimenting with Concurrency in Java/JavaFX. Printing must run in a different thread otherwise it will make the JavaFX main thread freeze for a couple seconds. Right now my printing is done with this simplified example. public void print(PrintContent pt) { setPrintContent(pt); Thread thread = new Thread(this); thread.start(); } @Override public void run() { // send content to printer } With this code I am sending many print jobs parallel to my printer. Therefore I get the

How to fill between two AreaCharts in JavaFX?

荒凉一梦 提交于 2020-01-05 04:09:09
问题 The Area Chart in JavaFX fills the area between the data line and the zero y-axis. I would only like to know how to fill between two Area Charts. More Details: I am generating a bunch of random walks. Then, I create three different XYCharts for the Paths, the mean, and the mean +/- std. deviation. Finally, I use a StackPane to place each chart on top of each other with transparent background. The order of the charts has to be the following: 1. Simulated paths chart on the very back (LineChart

JavaFX pausing during for loop WITHOUT using Thread.Sleep()

对着背影说爱祢 提交于 2020-01-05 04:08:11
问题 I'm coding this in JavaFX using a FXMLController and the scene builder. I'm currently creating an Instagram "liker" mostly just for practice as I'm a Computer Science major, and I just like coding. My issue is, I have a for loop that "likes" 20 photos for each hashtag, I obviously need a delay or I'd get banned rather quickly. The user can choose the delay, then I randomize this delay so it's not too robotic. The only way I've been able to use this delay is through the thread.sleep method,