'Error during the initialization of a boot layer
So I recently starting using JavaFX to create GUI's in Java and for some reason I'm getting a issue when trying to run the program. This is the first time I've seen this issue arise and after some looking online I can't find a solution.
Below is my code.
package application;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Main extends Application {
Button bt7, bt8, bt9;
Button bt4, bt5, bt6;
Button bt1, bt2, bt3;
Button bt0;
Button btDec, btAdd, btSub,btMult, btDiv;
Button btC, btEq;
TextField display;
@Override
public void start(Stage primaryStage) {
// Creating a VBox to hold all of the HBox objects used for the calculator. This will be the parent to the multiple row HBox objects and the input and equals objects.
VBox vbox = new VBox();
// Creating the text field object and its parameters.
display = new TextField();
display.setEditable(false); // Setting the text field object in order not to be changed.
display.setStyle("-fx-font: 20 mono-spaced;"); //Setting the font to 20 and making it mono-spaced.
display.setText("0.0"); //Setting the text to 0.0.
HBox input = new HBox(display);
vbox.getChildren().add(input);
// The next set of code will be adding the buttons to the pane. This is done by creating buttons for the corresponding rows. Once the buttons have been created they are added to the corresponding HBox object then added to the VBox class.
//Row 1. 7, 8, 9, Divide
bt7 = new Button("7");
bt7.setMinHeight(50);
bt7.setMinWidth(50);
bt8 = new Button("8");
bt8.setMinHeight(50);
bt8.setMinWidth(50);
bt9 = new Button("9");
bt9.setMinHeight(50);
bt9.setMinWidth(50);
btDiv = new Button("/");
btDiv.setMinHeight(50);
btDiv.setMinWidth(50);
HBox r1 = new HBox(bt7, bt8, bt9, btDiv);
vbox.getChildren().add(r1);
//Row 2. 8, 5, 2, 0
bt4 = new Button("4");
bt4.setMinHeight(50);
bt4.setMinWidth(50);
bt5 = new Button("5");
bt5.setMinHeight(50);
bt5.setMinWidth(50);
bt6 = new Button("6");
bt6.setMinHeight(50);
bt6.setMinWidth(50);
btMult = new Button("*");
btMult.setMinHeight(50);
btMult.setMinWidth(50);
HBox r2 = new HBox(bt4, bt5, bt6, btMult);
vbox.getChildren().add(r2);
//Row 3. 9, 6, 3
bt1 = new Button("1");
bt1.setMinHeight(50);
bt1.setMinWidth(50);
bt2 = new Button("2");
bt2.setMinHeight(50);
bt2.setMinWidth(50);
bt3 = new Button("3");
bt3.setMinHeight(50);
bt3.setMinWidth(50);
btSub = new Button("-");
btSub.setMinHeight(50);
btSub.setMinWidth(50);
HBox r3 = new HBox(bt1, bt2, bt3, btSub);
vbox.getChildren().add(r3);
//Row 4. /, *, -, +
btC = new Button("C");
btC.setMinHeight(50);
btC.setMinWidth(50);
bt0 = new Button("0");
bt0.setMinHeight(50);
bt0.setMinWidth(50);
btDec = new Button(".");
btDec.setMinHeight(50);
btDec.setMinWidth(50);
btAdd = new Button("+");
btAdd.setMinHeight(50);
btAdd.setMinWidth(50);
HBox r4 = new HBox(btC, bt0, btDec, btAdd);
vbox.getChildren().add(r4);
//Adding the equals button.
btEq = new Button("=");
btEq.setMinHeight(50);
btEq.setMinWidth(200);
HBox r5 = new HBox(btEq);
vbox.getChildren().add(r5);
// Create a scene and place it in the stage
Scene scene = new Scene(vbox, 200, 290);
primaryStage.setTitle("JavaFX GUI Calc"); // Set title
primaryStage.setScene(scene); // Place the scene in the stage
primaryStage.show(); // Display the stage
}
}
This is the error code I am given:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module MyName12JavaFXScientificCalc not found
This isn't the file I am trying to run so I'm not sure if its an eclipse problem. I have all of my classes defined under module path. Those classes being my user created JavaFX library, JavaFX SDK, and the JRE System Library.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
