javafx

JavaFX - ScrollPane with StackPane - StackPane's children not layouted when viewportBounds change

◇◆丶佛笑我妖孽 提交于 2019-12-24 22:08:41
问题 So the main issue what i have is when clicking on a ScrollBar Button. The Viewport of the Scrollpane changes, but not the children (Node) of the pane. I have either to request the focus on the pane or click on the icon in the taskmenu, that the Viewport content get's refreshed. Swing does this automatically when you move the scrollbars. Is there another way to get this functionality working as described above and by code? The call requestFocus() seems strange to me. By the way: it highlights

Drawing Sin and Cosine graphs in Javafx

…衆ロ難τιáo~ 提交于 2019-12-24 21:55:57
问题 I need to draw a Sine wave and a Cosine wave separately, which I will then use as class objects for a larger program. (these lines are just for plotting a path) The problem I am running into is simply that - while I know how to draw basic shapes like a circle, an arc, or a polygon - I don't know how to arrange these into a graph. I tried looking up tutorials and examples, but the only javafx examples I can find use depreciated features or don't use javafx at all. I thought about just drawing

How to delay the Drag-Start to combine move and Drag-And-Drop dynamically

倾然丶 夕夏残阳落幕 提交于 2019-12-24 21:50:24
问题 I want to provide an application that: allows to move images around (here a rectangle) if that object is moved out of the working area, start Drag-and-Drop for transfere to other applications So the javafx DragDetected() would come too soon during the object move on the canvas area, I suppress the onDragDetected() handling and in the onMouseDragged() handler I tried to convert the MouseDrag event into a Drag event using event.setDragDetect(true); But the onDragDetected() comes never again....

How to transfer string between methods (Java)

别等时光非礼了梦想. 提交于 2019-12-24 21:21:10
问题 Essentially, I'm trying to collect data for a string and use it in another method. Whatever I've tried hasn't seemed to work. Please check out my code and tell me what to do. I've tried to declare the string as a public string, but since it is in a method I can't. My goal is to transfer the string "application_1" to button3's setOnAction method. @Override public void start(Stage primaryStage) throws Exception { window = primaryStage; window.setTitle("myDesktop"); window.setOnCloseRequest(e ->

JavaFX PasswordField echo char different on Different computer

橙三吉。 提交于 2019-12-24 21:03:52
问题 I try to run javafx Password Field Demo on my desktop enviroment: win7 64 cmd->chcp:GBK java -version java version "1.8.0_161" Java(TM) SE Runtime Environment (build 1.8.0_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode) jdk version switch to " 1.8.0_191 " and " 1.8.0_131 ",the same result. then I tried to run the Demo on my colleague's desktop win7 64 cmd->chcp:UTF-8 java -version java version "1.8.0_161" Java(TM) SE Runtime Environment (build 1.8.0_161-b12) Java

JavaFX FXML controller ClassNotFoundException

混江龙づ霸主 提交于 2019-12-24 21:01:06
问题 I am trying to get a TableView in JavaFX to dynamically display content. When I run my program I get this error: java.lang.ClassNotFoundException: UserInterfaceController My controller is named "UserInterfaceController.java", it's under the same package as the FXML file and I have imported the package in the FXML as well. Why can't the controller be found? FXML file: <?import javafx.collections.*?> <?import javafx.geometry.Insets?> <?import java.lang.*?> <?import javafx.scene.*?> <?import

ImageView in javaFx is not shown when i run it as webstart or in browser

一世执手 提交于 2019-12-24 20:55:20
问题 I've been trying to load an image into an ImageView , and it works fine when I run it as a standalone app, but when I try to run it in the browser or as webstart it doesn't get shown. I've tried: ivFoto = new ImageView(new Image("file:/C:/Users/Carlos/Desktop/4fbzW.jpg")); or ivFoto = new ImageView(new Image("file:\\C:\\Users\\Carlos\\Desktop\\4fbzW.jpg")); or ivFoto = new ImageView("file:///C:/Users/Carlos/Desktop/4fbzW.jpg"); If anyone has any idea of what I'm doing wrong here, I would

JavaFX imageview actions

*爱你&永不变心* 提交于 2019-12-24 20:48:57
问题 I'm trying to build a replica of MineSweeper, to do this I'm trying to setup some premade images (100x100 pixels made in Photoshop) into an imageview and then when clicked hiding it (to reveal the number below). Without much complexity -- Just the image going visible and invisible I am finding a lot of issues and difficulties. It is likely due to a complete lack of knowledge on Javafx in general but I even following tutorials to the t I am still unable to implement this feature. I will attach

Context menu insight JavaFX Task

拥有回忆 提交于 2019-12-24 20:36:57
问题 I have a problem with Context menu. Following this topic I found that there is a limitation when I try to load Context menu insight JavaFX Task. I tested to implement Platform.RunLater() but without any success. static ContextMenu contextMenuPanel; public static BorderPane stageContextMenu(BorderPane bp) { Platform.runLater(new Runnable() { @Override public void run() { contextMenuPanel = new ContextMenu(); } }); MenuItem item1 = new MenuItem("About"); item1.setOnAction(new EventHandler

Errors when trying to use JFXPasswordField Jfoenix JAVA

与世无争的帅哥 提交于 2019-12-24 20:32:58
问题 I'm trying to create some GUI with Jfoenix and I'm getting following errors when i run them. I'm not understanding the errors and i have spent the whole day please guide me. <?xml version="1.0" encoding="UTF-8"?> <?import com.jfoenix.controls.JFXPasswordField?> <?import com.jfoenix.controls.JFXTextField?> <?import javafx.scene.layout.AnchorPane?> <AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="700.0" style="-fx-background-color: #20120F;" xmlns="http://javafx.com/javafx/9" xmlns:fx=