javafx

JVM中8种垃圾收集器小结

和自甴很熟 提交于 2020-12-10 19:24:20
JDK 发展历史 JAVA 1.0,代号Oak橡树) 于 1996-01-23 发行 JAVA 1.1 1997-02-19 发行, 主要更新内容: 引入 JDBC 添加内部类支持 引入 JAVA BEAN 引入 RMI 引入反射 JAVA 1.2, 代号 Playground(操场) 1998-12-8 发行,主要更新内容: 引入集合框架 对字符串常量做内存映射 引入 JIT(Just In Time)编译器 引入打包文件数字签名 引入控制授权访问系统资源策略工具 引入 JFC(Java Foundation Classes),包括 Swing1.0,拖放和 Java2D 类库 引入 Java 插件 JDBC 中引入可滚动结果集,BLOB,CLOB, 批量更新和用户自定义类型 Applet 中添加声音支持 JAVA1.3,代号 Kestrel(红隼) 2000-5-8 发布,主要更新内容: 引入 Java Sound API 引入 jar 文件索引 对 Java 各方面多了大量优化和增强 Java Platform Debugger Architecture 用于 Java 调式的平台。 JAVA 1.4,代号 Merlin(隼) 2004-2-6 发布(首次在 JCP 下发行),主要更新内容: 添加 XML 处理 添加 Java 打印服务(Java Print Service

JavaFX ImageView fits container

只愿长相守 提交于 2020-12-10 11:55:28
问题 I'm trying to fit an ImageView in an AnchorPane, the ImageView is obtained from a database, so no CSS, I tried binding the width and height of the ImageView withe the width and height of the AnchorPane, but I get this result: Here's my fxml: <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.Label?> <?import javafx.scene.image.ImageView?> <?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.text.Font?> <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity"

JavaFX ImageView fits container

耗尽温柔 提交于 2020-12-10 11:54:14
问题 I'm trying to fit an ImageView in an AnchorPane, the ImageView is obtained from a database, so no CSS, I tried binding the width and height of the ImageView withe the width and height of the AnchorPane, but I get this result: Here's my fxml: <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.Label?> <?import javafx.scene.image.ImageView?> <?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.text.Font?> <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity"

Bind TextField to ReadOnlyDoubleProperty

久未见 提交于 2020-12-08 07:39:13
问题 I can bind a TextField 's text property to a DoubleProperty , like this: textField.textProperty().bindBidirectional(someDoubleProperty, new NumberStringConverter()); But what if my someDoubleProperty is an instance of ReadOnlyDoubleProperty instead of DoubleProperty ? I am acutally not interested in a bidirectional binding. I use this method only because there is no such thing as textField.textProperty().bind(someDoubleProperty, new NumberStringConverter()); Do I need to use listeners instead

How to add hint text in a Textfield in JavaFX

本小妞迷上赌 提交于 2020-12-08 06:15:49
问题 I want to add some hint text in a textfield, like "name" or "surname". I create the textfield like this TextField userTextField = new TextField(); , but I cannot find how to do that. Here, I just found this Clear prompt text in JavaFX TextField only when user starts typing but I cannot believe this is the only way to do it. Or I am wrong? 回答1: I do it like this: userTextField.setPromptText("name"); //to set the hint text userTextField.getParent().requestFocus(); //to not setting the focus on

How to add hint text in a Textfield in JavaFX

∥☆過路亽.° 提交于 2020-12-08 06:13:20
问题 I want to add some hint text in a textfield, like "name" or "surname". I create the textfield like this TextField userTextField = new TextField(); , but I cannot find how to do that. Here, I just found this Clear prompt text in JavaFX TextField only when user starts typing but I cannot believe this is the only way to do it. Or I am wrong? 回答1: I do it like this: userTextField.setPromptText("name"); //to set the hint text userTextField.getParent().requestFocus(); //to not setting the focus on

Why isn't it enough put all JavaFX deps in the classpath w/o bothering about Java modules?

陌路散爱 提交于 2020-12-07 18:08:06
问题 I've been trying to write Hello JavaFX app and faced with necessity consider about Java modules for starting the app. F.e. javafx-maven-plugin 's run goal produce such startup command: [DEBUG] Executing command line: [C:\java\zulu14.29.23-ca-jdk14.0.2-win_x64\bin\java.exe, --module-path, C:\.m2\repository\org\openjfx\javafx-base\14\javafx-base-14-win.jar; C:\.m2\repository\org\openjfx\javafx-base\14\javafx-base-14.jar; C:\.m2\repository\org\openjfx\javafx-controls\14\javafx-controls-14-win

How to pass paremeter with an event in javafx?

蹲街弑〆低调 提交于 2020-12-06 08:50:34
问题 I have this following example, where I want to pass my paremeter "text" together with my event (when my button "bla" is clicked). How can I do it? EventHandler<MouseEvent> handler = new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { System.out.println(text); } }; public void test(){ //... Text text = "123567"; bla.setOnMousePressed(handler); //... } Small question: When I do have the following: object1.setOnMouseClicked( event -> { System.out.println("HELLO"); }

How to pass paremeter with an event in javafx?

南楼画角 提交于 2020-12-06 08:47:49
问题 I have this following example, where I want to pass my paremeter "text" together with my event (when my button "bla" is clicked). How can I do it? EventHandler<MouseEvent> handler = new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { System.out.println(text); } }; public void test(){ //... Text text = "123567"; bla.setOnMousePressed(handler); //... } Small question: When I do have the following: object1.setOnMouseClicked( event -> { System.out.println("HELLO"); }

Javafx change osx menubar name

假如想象 提交于 2020-12-05 00:56:29
问题 I am using Netbeans trying to change the title when the program runs from java to Phantom . I also would like to change where it says phantom.Main to Phantom . I am not sure if I do this in: Java, Netbeans, Netbeans priorities or the ant build.xml file (or even somewhere else). I can not find any documentation on this either. Any help on this would be great! 回答1: The "java" name in the (Mac OS X) application menu is only used when you run the application from within Netbeans. If you were to