javafx

JavaFX WebView up call from JavaScript doesn't work

萝らか妹 提交于 2020-05-13 06:28:08
问题 I have a JavaFX WebView and want to call the method "hello" of the class "JavaBridge" from "test.html" displayed in the webview. Why doesn't this work? I making sure that the "bridge" object only be added to the window.object when the page has been fully rendered, so that is probably not the problem. I can't see any problem with the HTML either. Here is the HTML code ("test.html"): <html> <head> </head> <body> <a href="#click" onclick="bridge.hello()">call java</a> </body> </html> And here is

JavaFX WebView up call from JavaScript doesn't work

让人想犯罪 __ 提交于 2020-05-13 06:27:25
问题 I have a JavaFX WebView and want to call the method "hello" of the class "JavaBridge" from "test.html" displayed in the webview. Why doesn't this work? I making sure that the "bridge" object only be added to the window.object when the page has been fully rendered, so that is probably not the problem. I can't see any problem with the HTML either. Here is the HTML code ("test.html"): <html> <head> </head> <body> <a href="#click" onclick="bridge.hello()">call java</a> </body> </html> And here is

JavaFX 3D Colouring faces … again

混江龙づ霸主 提交于 2020-05-13 04:55:14
问题 I studied this question, but I still don't get it. The shortest possible code below shows a Pyramid totally grey, whereas I try to give the 6 triangles making up the pyramid different colors. So ... why don't these colors show up? Note that I borrowed the getTexCoords().addAll(..) statement from that question, but clearly I still am doing something wrong. Is it the uv mapping ? What is that anyway? I have seen a topological explanation ( sphere <-> map ), but what has that got to do with

JavaFX 3D Colouring faces … again

笑着哭i 提交于 2020-05-13 04:50:58
问题 I studied this question, but I still don't get it. The shortest possible code below shows a Pyramid totally grey, whereas I try to give the 6 triangles making up the pyramid different colors. So ... why don't these colors show up? Note that I borrowed the getTexCoords().addAll(..) statement from that question, but clearly I still am doing something wrong. Is it the uv mapping ? What is that anyway? I have seen a topological explanation ( sphere <-> map ), but what has that got to do with

How to create tabs with icons in JavaFX

亡梦爱人 提交于 2020-05-09 19:43:18
问题 I want to create tabs panel with icons similar to the Firefox configuration panel with JavaFX: Is there any example which I can use to see how to implement this? 回答1: Tabs, like many other elements in JavaFX, have a method called setGraphic(Node value) , in which you can put any JavaFX node. Example: import javafx.application.Application; import javafx.geometry.Pos; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.control.Tab; import

How to change textfield inputs to only numbers in javafx? [duplicate]

為{幸葍}努か 提交于 2020-05-09 10:29:13
问题 This question already has answers here : What is the recommended way to make a numeric TextField in JavaFX? (22 answers) Restricting a TextField input to hexadecimal values in Java FX (3 answers) Closed 8 months ago . I have a credit card page in my java fx program. I am trying to make it so that the inputs only allow numbers. At the moment it only gives an error if the fields are empty. But no error occurs if text is included? I have tried changing it from String to integer, but that doesn't

JavaFX的窗体为“StageStyle.UNDECORATED”时,如何使用鼠标移动窗体

左心房为你撑大大i 提交于 2020-05-05 23:56:41
如题,因为“StageStyle.UNDECORATED”将会title bar隐藏,用户无法使用鼠标移动窗体。需要通过增加鼠标的“Pressed”、“Dragged”事件处理获取鼠标信息来移动窗体。具体代码如下。 /** * @package ch04 * @date 2020/5/5 * @author qiaowei * @version 1.0 * @description */ import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.input.MouseEvent; import javafx.scene.layout.VBox; import javafx.stage.Stage; import javafx.stage.StageStyle; public class DraggingStage extends Application { public static void main(String[] args) { launch(args); } @Override public void start

JavaFx出现错误Caused by: java.lang.NullPointerException: Location is required的解决方法

﹥>﹥吖頭↗ 提交于 2020-05-03 16:58:58
问题截图: "C:\Program Files\Java\jdk1.8.0_131\bin\java.exe" "-javaagent:I:\IntelliJ IDEA 2018.2.5\lib\idea_rt.jar=53553:I:\IntelliJ IDEA 2018.2.5\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_131\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_131\jre\lib\ext\jfxrt.jar;C:

Event listener for multiple selection in a JavaFx listview

*爱你&永不变心* 提交于 2020-05-01 04:21:24
问题 I have a JavaFX listview in my code and multiple items can be selected. I have already figured out which event listener I need to use when an item is selected but this listener isn't always triggered when i deselect an item. So my question is, is there an event listener for both selecting and deselecting items? This is the event listener I'm currently using: lvLijst.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() { @Override public void changed

Javafx 10 or older for download to create a runnable jar file

旧时模样 提交于 2020-04-30 06:25:55
问题 I am looking for javafx 10 or newer. I currently have javafx-sdk-11 and trying to make my programme a single runnable jar file, but apparently since javafx 11, that option isn't available anymore. So I have to go to the terminal and type the following line to run it : java --module-path /path/to/javafx/javafx-sdk-11.0.2 or another/lib --add-modules javafx.controls,javafx.fxml,javafx.graphics,javafx.web -jar /path/to/GUI_Music_Gen.jar Since I can't find older versions of javafx available for