javafx

Custom Event Dispatcher - JavaFX

浪子不回头ぞ 提交于 2020-07-20 04:25:12
问题 Does anyone know how to write a custom Event Dispatcher based on the javafx.event package? I searched in Google & Co. but didn't find a nice example. Have anyone a minimalistic example for me? That would be nice - I tried it a few times to understand it, but I failed. 回答1: The first thing to realize is how JavaFX dispatches events. When an Event is fired it has an associated EventTarget . If the target was in the scene-graph then the path of the Event starts at the Window and goes down the

How to setup webview in javafx?

左心房为你撑大大i 提交于 2020-07-16 10:37:38
问题 @FXML void openCaptchaSolver(MouseEvent event) { Stage primaryStage = (Stage)((Node)event.getSource()).getScene().getWindow(); Stage secondaryStage = new Stage(); secondaryStage.initOwner(primaryStage); WebView web = new WebView(); WebEngine engine = web.getEngine(); engine.load("https://www.google.com"); VBox root = new VBox(); root.getChildren().addAll(web); secondaryStage.setScene(new Scene(root, 500, 575)); secondaryStage.setTitle("Captcha Solver"); secondaryStage.initModality(Modality

JavaFX 8 count rows in “textarea”

六月ゝ 毕业季﹏ 提交于 2020-07-16 08:28:07
问题 We are trying to count the number of rows in a TextArea Here are the TextArea properties PrefWidth 600 and PrefHeight 620 with MaxHeight 620 Wrap Text is set to true. We are using JavaFX 8 with Scene Builder We have a textPropertyListiner that will fire an Alert when the TextArea.getLength is greater than some value The issue with this method is it does not consider the user entering a carriage return \n So we implemented this code to capture the \n String toCount = txaDiaryEntry.getText();

JavaFX 8 count rows in “textarea”

旧街凉风 提交于 2020-07-16 08:27:03
问题 We are trying to count the number of rows in a TextArea Here are the TextArea properties PrefWidth 600 and PrefHeight 620 with MaxHeight 620 Wrap Text is set to true. We are using JavaFX 8 with Scene Builder We have a textPropertyListiner that will fire an Alert when the TextArea.getLength is greater than some value The issue with this method is it does not consider the user entering a carriage return \n So we implemented this code to capture the \n String toCount = txaDiaryEntry.getText();

How to make the javafx animation using path transition smooth?

∥☆過路亽.° 提交于 2020-07-09 14:51:22
问题 My goal for now is to make the animation of a little circle, going along the path of a big circle. In the future, I would need to dynamically change the speed of revolution using a slider, but that is not a problem now. I can't figure out how to make this animation smooth? By this I mean that I want my little circle to not slow down when it reaches the end of animation. Is this possible using path transition? Or should I use some other method to implement animation in order for it to be

How to make the javafx animation using path transition smooth?

我的梦境 提交于 2020-07-09 14:50:26
问题 My goal for now is to make the animation of a little circle, going along the path of a big circle. In the future, I would need to dynamically change the speed of revolution using a slider, but that is not a problem now. I can't figure out how to make this animation smooth? By this I mean that I want my little circle to not slow down when it reaches the end of animation. Is this possible using path transition? Or should I use some other method to implement animation in order for it to be

How to add AwesomeFontFX Icon Pack to JavaFX Project in IntelliJ IDEA?

五迷三道 提交于 2020-07-09 12:57:52
问题 I am creating a mini-JavaFX project and wanted to use the Awesome Font Icon Pack.I loaded the fontawesomefx-8.9 using the Scenebuilder and opened the FXML in it and loaded two icons in it, also added the JAR file in External Libraries in IntelliJ but when I run the code it gives a ClassNotFoundException for de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView. What should I do? I removed the two Icons and the code runs fine. I searched many places but it only showed to add the JAR files to

How to make auto re-sizable border pane for “drawer” menu

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-09 12:51:49
问题 I have BorderPane as my Root. Left side contains slide-out menu and center has container to keep components. I want to stretch the length of my main container to the width of the stage, when slide-out menu is hiding and opposite. I tried to scale my BorderPane mainContent by ScaleTransition, but it goes wrong. ScaleTransition just stretch , do not set width... @Override public void start(Stage primaryStage) throws Exception{ Label label = new Label("->"); label.setStyle("-fx-text-fill: orange

Slideshow from an ArrayList of images with JavaFX

风流意气都作罢 提交于 2020-07-09 06:58:26
问题 I'm trying to create a slideshow by taking an ArrayList of images and putting them into an ImageView using a for loop. However, in order to "pause" the program so that each image will be visible, I am trying to use Thread.sleep . This unfortunately hasn't had the desired effect. In trying to remedy this, my endless googling leads me to suspect that I should be using the Timeline class, but I have no idea how to implement it. Any help would be much appreciated. My dysfunctional code as it

How to start JavaFX 11 application outside IDE?

核能气质少年 提交于 2020-07-07 06:50:08
问题 I downloaded: - OpenJDK 11.0.2 - JavaFX SDK 11.0.2 Both files are extracted to path C:/Program Files/Java/ OS: Windows 10 IDE: NetBeans 10.0 Paths: JAVA_HOME = C:/Program Files/Java/jdk-11.0.2 PATH_TO_FX = C:/Program Files/Java/javafx-sdk-11.0.2/lib Inside Path system variable add %JAVA_HOME%/bin In NetBeans I created Java Application project named JFXDev which contains one package com. Inside com package is one main class with following code: package com; import javafx.application