我无法让 OpenJFX 在我的项目中工作。我将该库导入到我的 IntelliJ 项目中,它解决了所有构建错误,但是当我启动我的程序时,什么也没有发生。控制台没有给我任何输出。该程序启动,然后无限期运行,不显示任何内容。当我停止程序时它说Process finished with exit code 130 (interrupted by signal 2: SIGINT)
Main.java
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
}
@Override
public void start(Stage stage) throws Exception {
stage.setTitle("Binary Clock");
stage.setScene(new Scene(FXMLLoader.load(getClass().getResource("clock_gui.fxml"))));
stage.show();
}
}
ClockGui.java(作为控制器)
import javafx.fxml.FXML;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
public class ClockGui {
@FXML
private Rectangle ht8;
public ClockGui(){
ht8.setFill(Color.rgb(225,250,30));
}
}
我在 Ubuntu 18.04.2 LTS 上。
狐的传说
慕田峪9158850
随时随地看视频慕课网APP
相关分类