javafx

Retrieving metadata from media files in JavaFX

旧巷老猫 提交于 2021-01-28 03:11:32
问题 I've a MediaPlayer which plays the music chosen by the user from the library. While creating the library, the songs are required to be listed by their title. I know I can acquire all metadatas using a Media object. But that is arising two problems. I) The whole process is very time and resource consuming for a large media collection II) Even if I do so using the following code for(String path : paths){ Media m = new Media(path); String title = (String)m.getMetadata().get("title"); String

JavaFX mouse drag events not firing

女生的网名这么多〃 提交于 2021-01-28 02:50:48
问题 I tried almost everything, but the mouse drag events are not firing, like explained here: https://openjfx.io/javadoc/11/javafx.graphics/javafx/scene/input/MouseDragEvent.html Here is a minimal example, so you can try it out (I am using Java 11 with JavaFX 11.0.2): import javafx.application.Application; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.*; import javafx.stage.Stage; public class Main extends Application {

Image as splashscreen for JavaFX application not hiding automatically

∥☆過路亽.° 提交于 2021-01-28 02:49:25
问题 I have a simple .png image file that I wish to show while the JavaFX application is loading. I am using NetBeans as my IDE and I know that splashscreen can be added like so: Project properties -> Run -> VM Options: -splash:path-to-image Now the splashscreen starts nicely, but it won't close after my application has started. Just sits there on the screen until I close my application completely. As the documentation says (http://docs.oracle.com/javase/7/docs/api/java/awt/SplashScreen.html) "The

How to clone javafx.scene.image.Image?

烈酒焚心 提交于 2021-01-28 00:56:14
问题 Is it possible to clone javafx.scene.image.Image , not using pixel by pixel copying? Or this is the only way? 回答1: The code below copied from your link and put into a separate function is definitely not the "only" solution to the problem. It is definitely the best work-around that i personally know of. So here is the code for cut&paste: copyImage /** * copy the given image to a writeable image * @param image * @return a writeable image */ public static WritableImage copyImage(Image image) {

JavaFx ComboBox binding confusion

房东的猫 提交于 2021-01-28 00:05:15
问题 I have an I18N implementation that binds JavaFX UI elements through properties, for e.g.: def translateLabel(l: Label, key: String, args: Any*): Unit = l.textProperty().bind(createStringBinding(key, args)) Having a property binding is easy and works well. However I struggle with ComboBox as it takes an ObservableList (of Strings in my case) and I have no idea how to bind my translator functions to that. I am conflicted about the difference between ObservableValue , ObservableList and Property

Subclassing JavaFX Stage / Scene

萝らか妹 提交于 2021-01-27 23:49:24
问题 Coming from Swing and being new to JavaFX I tried to subclass Java FX Stages and Scenes. However I quickly run into problems, like the init method not being of my subclassed sceen not being found during the initialization. So I was wondering: Are Java FX Stages and Sceens to be subclassed like one would subclass JFrames and JPanels in Swing or is this discouraged? 回答1: You can subclass Scene and Stage and many other FX library classes in pretty much the same way. I'm not sure I'd recommend it

FXML file inside javafxports project

大兔子大兔子 提交于 2021-01-27 17:40:35
问题 I'm looking information about javafxports technology and can I use inside this project FXML file. This is my build.gradle: buildscript { repositories { jcenter() } dependencies { classpath 'org.javafxports:jfxmobile-plugin:1.1.0' } } apply plugin: 'org.javafxports.jfxmobile' repositories { jcenter() maven { url 'http://nexus.gluonhq.com/nexus/content/repositories/releases' } } mainClassName = 'com.orden.First' dependencies { compile 'com.gluonhq:charm:4.0.0' // Desktop SQL -> https://github

JavaFX Export and VM arguments

て烟熏妆下的殇ゞ 提交于 2021-01-27 15:01:01
问题 I have the problem that I just can't export my JavaFX application. I can get it running with the VM arguments (inside the IDE and outside) but that's far from optimal. I want a simple "click to open" experience. Error: JavaFX runtime components are missing, and are required to run this application I am aware that this problem can be fixed with the vm arguments but as I said before "click to open" experience. I tried to make a fat jar using maven. (Here is my pom.xml): <project xmlns="http:/

Build Java module runtime image for other OS

╄→尐↘猪︶ㄣ 提交于 2021-01-27 07:28:50
问题 I have rewritten my little Java 8 project from simple jar to single module in Java 11. In past I was building jar with Gradle and it was compatible with Windows and Linux. Now I configured Gradle to build my module and create custom runtime image and it is working but only on Linux. My custom runtime image contains only Linux libraries. Is there possibility to build image for Windows on Linux? I know I could open my project on Windows and create there image but I would like to keep my project

Build Java module runtime image for other OS

≯℡__Kan透↙ 提交于 2021-01-27 07:28:48
问题 I have rewritten my little Java 8 project from simple jar to single module in Java 11. In past I was building jar with Gradle and it was compatible with Windows and Linux. Now I configured Gradle to build my module and create custom runtime image and it is working but only on Linux. My custom runtime image contains only Linux libraries. Is there possibility to build image for Windows on Linux? I know I could open my project on Windows and create there image but I would like to keep my project