package org.gng.semiqe; import javafx.application.Application; import javafx.embed.swing.SwingNode; import javafx.scene.Scene; import javafx.scene.layout.StackPane; import javafx.stage.Stage; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.SwingUtilities; import javafx.geometry.Pos; public class HelloFXSW extends Application { @Override public void start (Stage stage) { final SwingNode swingNode1 = new SwingNode(); final SwingNode swingNode2 = new SwingNode(); createSwingContent(swingNode1,swingNode2); StackPane pane = new StackPane(); StackPane.setAlignment(swingNode1, Pos.TOP_CENTER); pane.getChildren().addAll(swingNode1,swingNode2); stage.setTitle("Swing in JavaFX"); stage.setScene(new Scene(pane, 640, 480)); stage.show(); } private void createSwingContent(final SwingNode swingNode1,final SwingNode swingNode2) { SwingUtilities.invokeLater(() -> { String javaVersion = System.getProperty("java.version"); String javafxVersion = System.getProperty("javafx.version"); JLabel lbl = new JLabel("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + "."); swingNode1.setContent(lbl); swingNode2.setContent(new JButton("Click me!")); }); } }
2020-07-13 07:38:27.593 [Connection.ReaderThread:Socket[addr=/127.0.0.1,port=63709,localport=60001]] ERROR o.e.j.autagent.OsgiAUTStartHelper - No bundle found for ID 'com.thoughtworks.xstream'. 2020-07-13 07:38:27.593 [Connection.ReaderThread:Socket[addr=/127.0.0.1,port=63709,localport=60001]] ERROR o.e.j.autagent.OsgiAUTStartHelper - No bundle found for ID 'org.xmlpull'. 2020-07-13 07:38:29.738 [Connection.ReaderThread:Socket[addr=localhost/127.0.0.1,port=60001,localport=63709]] ERROR o.e.j.c.i.c.StartAUTServerStateCommand - AUTServer could not start: Invalid arguments.; Picked up _JAVA_OPTIONS: "-javaagent:C:\utils\jubula_8.7.1.046\ite\plugins\org.eclipse.jubula.rc.common.agent_7.0.2.201902270829.jar" WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/C:/Users/gng/AppData/Local/Temp/com.thoughtworks.xstream-1.3.1.v2011112409242167391810650255551.jar) to field java.util.Properties.defaults WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Error: Could not find or load main class C:\utils\jubula_8.7.1.046\ite Caused by: java.lang.ClassNotFoundException: C:\utils\jubula_8.7.1.046\ite]]>
AUT Executable: C:\utils\jdk-11.0.7\bin\javaw.exe AUT Arguments: --module-path c:\utils\javafx-sdk-11.0.2\lib --add-modules=javafx.controls,javafx.swing --add-opens javafx.swing/javafx.embed.swing=ALL-UNNAMED --add-opens javafx.controls/javafx.scene.control.skin=ALL-UNNAMED --illegal-access=permit -jar C:\projects\DStestSwing2\target\hellofxsw-1.0-SNAPSHOT.jar