javafx

JavaFx optional parameters for controller class in start method when it is loaded into the FXML

跟風遠走 提交于 2019-12-24 19:00:23
问题 with the ScheneBuilder I defined the controller class of my fxml, the code genereted inside my AnchorPane tag is: fx:controller="demo.SplashController" now I would like if I had args in the main, to load a new version of the controller, using the appropriate construct. I try this code in the Application.start: FXMLLoader loader = new FXMLLoader(getClass().getResource("page.fxml")); PageController controller; if(!dir.equals("")){ //attribute coming from args controller = new PageController(dir

JavaFX ObjectProperty that fires change events even if newValue == oldValue

依然范特西╮ 提交于 2019-12-24 18:51:41
问题 ObjectPropertyBase skips value invalidation when newValue == oldValue : /** * {@inheritDoc} */ @Override public void set(T newValue) { if (isBound()) { throw new java.lang.RuntimeException((getBean() != null && getName() != null ? getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set."); } if (value != newValue) { value = newValue; markInvalid(); } } Problem: markInvalid() and value are private , therefore I cannot override set(newValue) properly.

Images not showing on launch by the main, but showed on Scene builder

人走茶凉 提交于 2019-12-24 18:45:50
问题 I'm new on coding, especialy in java, and i've tryed to use JavaFx with scene builder. My issue today is that i've done that menu with scene builder: https://imgur.com/a/IH0lf And when I run it the images doesn't show. I've try with other scenes i've made, same issue. https://imgur.com/a/UuCMi Here is my Main : package com.doki; import java.io.IOException; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.layout.AnchorPane;

Images not showing on launch by the main, but showed on Scene builder

戏子无情 提交于 2019-12-24 18:43:30
问题 I'm new on coding, especialy in java, and i've tryed to use JavaFx with scene builder. My issue today is that i've done that menu with scene builder: https://imgur.com/a/IH0lf And when I run it the images doesn't show. I've try with other scenes i've made, same issue. https://imgur.com/a/UuCMi Here is my Main : package com.doki; import java.io.IOException; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.layout.AnchorPane;

Exception in Application start method java.lang.reflect.InvocationTargetException JavaFX image transition

徘徊边缘 提交于 2019-12-24 18:31:25
问题 When i try to add image transition for my JavaFX app, it has thrown this error,I checked the previous questions and answers here in Stackoverflow, but all the solutions were specific for each of those questions only.I am using netbeans IDE. Executing H:\thirdf\FinalF\dist\run2135548605\FinalF.jar using platform C:\Program Files\Java\jdk1.8.0_101\jre/bin/java Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native

How to create a javafx 2.0 application MDI

爱⌒轻易说出口 提交于 2019-12-24 18:21:06
问题 How to implement something kinda internal frame in JavaFx 2.0 specifically? My attempt is as so.. import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class Main extends Application { ConnectDb connection; public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage

JavaFX desktop app won't start in a specific machine (works in others)

心不动则不痛 提交于 2019-12-24 18:15:12
问题 I have a java desktop app using Swing which I rewrote in JavaFX using SceneBuilder. The Swing app works fine on all users machines (35 Machine). After rewriting the app in JavaFX, on one specific machine the app won't start and gives the below error message. I couldn't figure out the issue. I appreciate if someone can give any help. Thank you. Exception in Application start method java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0

ImageView: animated gif preview

久未见 提交于 2019-12-24 18:09:56
问题 I am putting together an image gallery that displays a preview of the image. For most of the images this is no problem, only when the image is an animated gif the image is animated as well, which in this case is not necessary. What I would like to do for an animated gif is to just display one frame of the animation. While searching for a solution I have come across this. GifDecoder d = new GifDecoder(); d.read( filename); WritableImage wimg = null; Image img = SwingFXUtils.toFXImage(d

Javafxports and SQLite -> open failed: EPERM (Operation not permitted)

允我心安 提交于 2019-12-24 17:48:04
问题 i m trying to code a simple sqlite code with javafxports. build.gradle: buildscript { repositories { jcenter() } dependencies { classpath 'org.javafxports:jfxmobile-plugin:1.0.6' } } apply plugin: 'org.javafxports.jfxmobile' repositories { jcenter() maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url "https://oss.sonatype.org/content/repositories/releases" } } ext.CHARM_DOWN_VERSION = "1.0.0" dependencies{ compile 'org.xerial:sqlite-jdbc:3.8.11' compile "com

Nodes - Choose the Layer to appear JavaFX2

和自甴很熟 提交于 2019-12-24 17:08:42
问题 I want to be able to choose the layer that the Nodes appear and change it throughout the course of the program. I know that the last added Nodes appear on the top of the previous one. In swing, I use JLayeredPane and its method setLayout(JComponent, integer). The higher the int, the higher level the component appears on screen. Is there something similar? Thank you 回答1: I think you can play with the z-order indices of child nodes by combinations of Node node = pane.getChildren().get(index);