Information About Implementing JavaFX

Asked 2 years ago, Updated 2 years ago, 129 views

About implementing JavaFX.
The following error occurs in Eclipse:I've done my own research and prepared the following, but there's no change at all.

  • eclipse2019-3
  • Java11
  • e(fx)clipse 3.5.0
  • Open JFX (Honestly, I don't understand it)
    • javafx-jmods-13
    • javafx-sdk-13
  • javafx-jmods-13
  • javafx-sdk-13

Please let me know if there are any improvements.

Enter a description of the image here

add

package application;

import org.gralvm.compiler.phases.common.NodeCounterPhase.Stage;

import com.apple.eawt.Application;

import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;

public class Main extensions Application {
    @ Override
    public void start (Stage primaryStage) {
        try{
            BorderPane root=new BorderPane();
            Scenescene=new Scene(root,400,400);
            screen.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
            primaryStage.setScene(scene);
            primaryStage.show();
        } catch(Exceptione){
            e.printStackTrace();
        }
    }

    public static void main(String[]args) {
        launch(args);
    }
}

javafx

2022-09-30 21:42

1 Answers

The JavaFX SDK and GraalVM compiler libraries (jar files) are not set in the build path, so download them and add them to the build path.Also, some of the Main classes seem to be calling methods that do not exist.

JavaFX SDK https://gluonhq.com/products/javafx/

GraalVM Compiler https://mvnrepository.com/artifact/org.graalvm.compiler/compiler/1.0.0-rc16

add

The import is strange.Where javafx classes should be imported,

import org.gralvm.compiler.phases.common.NodeCounterPhase.Stage;
import com.apple.eawt.Application;

Importing an unrelated class of the same name.Please change it to the following two lines.

import javafx.stage.Stage;
import javafx.application.Application;

Also, please remove the library of the GraalVM compiler from the build path.The build should now pass.


2022-09-30 21:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.