javafx

How to disable mnemonic for JavaFX MenuBar?

大城市里の小女人 提交于 2021-01-27 05:22:18
问题 In my stage I have inserted a menubar at the top like usual for programs. I want to give the ALT key (together with arrow keys) some logic in another context within the stage. But everytime I press ALT and arrows I unintentionally navigate through the menus of the menubar, too. I want to avoid that or better completely disable this mnemonic behavior. Setting the mnemonicParsing properties of all menus to false failed. I also tried this approach without success: menubar.addEventFilter(KeyEvent

How to force anti-aliasing in JavaFX fonts?

给你一囗甜甜゛ 提交于 2021-01-27 02:28:31
问题 While testing the GUI of my JavaFX 8 application, I noticed that some labels are not displaying anti-aliased text. After some googling and struggling, I found out a very annoying thing that is happening. The anti-aliasing is being applied only on labels which font size is greater than 80px. Here is an example comparing JavaFX and Swing applications with AA applied: Sample code: https://gist.github.com/anonymous/be60bb89181376ff12aa Is there a way to force the AA in all font sizes? Does this

How to force anti-aliasing in JavaFX fonts?

自闭症网瘾萝莉.ら 提交于 2021-01-27 02:27:09
问题 While testing the GUI of my JavaFX 8 application, I noticed that some labels are not displaying anti-aliased text. After some googling and struggling, I found out a very annoying thing that is happening. The anti-aliasing is being applied only on labels which font size is greater than 80px. Here is an example comparing JavaFX and Swing applications with AA applied: Sample code: https://gist.github.com/anonymous/be60bb89181376ff12aa Is there a way to force the AA in all font sizes? Does this

Java9模块化指南

人盡茶涼 提交于 2021-01-26 18:25:49
1. 概述 Java9在包之上引入了一个新的抽象级别,正式称为Java平台模块系统(JPMS),简称“模块”。 在本文中,我们将介绍新系统并讨论其各个方面。 2. 什么是模块? 首先,我们需要先了解模块是什么,然后才能了解如何使用它们。 模块是一组密切相关的包和资源以及一个新的模块描述符文件。 换句话说,它是一个“Java包的包”的抽象,允许我们使代码更加 可重用 。 2.1 Packages 模块中的包与我们自Java诞生以来一直使用的Java包是相同的。 当我们创建一个模块时,我们将代码内部组织在包中,就像我们以前对任何其他项目所做的那样。 除了组织我们的代码外,还使用包来确定哪些代码可以在 模块外部公开访问 。我们将在本文后面花更多的时间讨论这个问题。 2.2 Resources 每个模块负责其资源,如媒体或配置文件。 以前,我们将所有资源放在项目的根级别,并手动管理属于应用程序不同部分的资源。 通过模块,我们可以将所需的图像和XML文件与需要的模块一起发送,从而使我们的项目更 易于管理 。 2.3 模块描述符 创建模块时,我们会包含一个描述符文件,该文件定义了新模块的几个方面: Name–我们模块的名称 依赖项–此模块依赖的其他模块的列表 公共包–我们希望从模块外部访问的所有包的列表 提供的服务–我们可以提供其他模块可以使用的服务实现 已使用的服务

Error:(3, 26) java: package javafx.application does not exist

二次信任 提交于 2021-01-26 03:08:28
问题 I have a new pc, I have installed inteliJ with JDK and JRE 9.0.1. I also installed SceneBuilder 9.0.1. I have copied the project that I had on old pc and when I run it I get this error: Error:(3, 26) java: package javafx.application does not exist. Do I need to install something else that contains this package? Thank you. 回答1: The JavaFX package is not included in JDK 9 and later. You need to install JDK 8, or you can add the JavaFX package separately, for example, from JDK 8 ( jfxrt.jar ).

Why does some nodes have a x and y position and others not

故事扮演 提交于 2021-01-25 03:18:42
问题 I'm trying to understand the coordinate system of JavaFX. For some nodes (shapes?) like Line or Rectangle I can (or should) specify a x and y value in the coordinate system. What exactly is this? Is this a translation and stretch which is later appended to the node or something else? Other nodes only have a setLayoutX() method, whereas e.g. the Line has both setLayoutX() as well as setStartX() . Thanks! 回答1: Every Node has two different bounds properties (ignoring Node#layoutBounds) relating

JavaFX - Bind stage size to the root node's preferred size

本小妞迷上赌 提交于 2021-01-24 11:39:49
问题 I would like to automatically adjust the width/height of a javafx.stage.Stage whenever the preferred width/height of the Scene 's root node changes. It's a small utility window (not resizable by the user) that contains multiple javafx.scene.control.TitledPane s and the window's height should increase when one of these TitledPanes is expanded (otherwise the TitlePane's content may be out of bounds). Unfortunately I could only find javafx.stage.Window.sizeToScene() , which initially sets the

JavaFX - Bind stage size to the root node's preferred size

隐身守侯 提交于 2021-01-24 11:39:47
问题 I would like to automatically adjust the width/height of a javafx.stage.Stage whenever the preferred width/height of the Scene 's root node changes. It's a small utility window (not resizable by the user) that contains multiple javafx.scene.control.TitledPane s and the window's height should increase when one of these TitledPanes is expanded (otherwise the TitlePane's content may be out of bounds). Unfortunately I could only find javafx.stage.Window.sizeToScene() , which initially sets the

How to avoid adding vm arguments everytime I create a new javafx project?

非 Y 不嫁゛ 提交于 2021-01-24 08:13:02
问题 I am creating javafx projects in STS(4.6.1) with e(fx)clipse plugin and scenebuilder. Everytime I create a new project, I have to add the VM arguments in run configurations: --module-path "/home/path/to/javafx sdk/lib" --add-modules javafx.controls,javafx.fxml otherwise the program ends with the error message which says Error: Could not find or load main class application.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application I have to do this for every javafx project

How to avoid adding vm arguments everytime I create a new javafx project?

我的梦境 提交于 2021-01-24 08:12:53
问题 I am creating javafx projects in STS(4.6.1) with e(fx)clipse plugin and scenebuilder. Everytime I create a new project, I have to add the VM arguments in run configurations: --module-path "/home/path/to/javafx sdk/lib" --add-modules javafx.controls,javafx.fxml otherwise the program ends with the error message which says Error: Could not find or load main class application.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application I have to do this for every javafx project