ユーザー入力を受け付けてファイルに保存するJavaFXアプリケーションを開発中です。シーンをスタイリングするために、私はCSSを使用しています。JavaFX jarの実行によりinvocationtargetexceptionがスローされる
私が使用しているIDEは、それがにInvocationTargetExceptionをスローし、私はjarファイルを実行しようとしたときはいつでも、私はjarファイル
These are all the files inside the project directory
public void start(Stage primaryStage) throws Exception {
String[] noti = {"Loading...","Verifying user...","Gathering info...","Success"};
primaryStage.initStyle(StageStyle.UNDECORATED);
VBox root = new VBox();
Scene scene = new Scene(root, 1100, 650);
Label label = new Label("Loading...");
ProgressBar progressBar = new ProgressBar(0.1);
Thread thr = new Thread(new Runnable() {
@Override
public void run() {
try{
Thread.sleep(1500);
progressBar.setProgress(0.2);
}catch(Exception e){}
}
});
primaryStage.setScene(scene);
root.getChildren().addAll(progressBar, label);
scene.getStylesheets().add(getClass().getResource("view/Main.CSS").toExternalForm());
File file = new File("C:\\Users\\SVNPC\\Documents\\NetBeansProjects\\portee\\TEST_1");
if(!file.exists()){
file.mkdir();
}
file = new File("C:\\Users\\SVNPC\\Documents\\NetBeansProjects\\portee\\TEST_1\\core.txt");
if(!file.exists() && !file.isDirectory()){
// Create the file and Fill it with user data
}
else{
}
primaryStage.show();
thr.start();
}
にすべてのクラスとファイルを詰め使用してNetBeansのです。 私はJavaFXのに新しいですし、私はこれらの多くの例外
This happened when I tried to run the JAR
Splash.javaファイルのコードを投稿してください。129行目にNullPointerExceptionがあります。 –
scene.getStylesheets()。(getClass()。getResource( "view/Main.CSS")。toExternalForm()); これは私が李に持っているものです:129 –
シーンはnullではありませんか?または、getStylesheetsがnullではありませんか? –