I am trying to make a stock system with a GUI using javaFX ive coded a gui for the TV and now another one for letting the owner to decide what how much to put in, after the use pressed the add button I want to call the TVGUI to let the customer specify more thing but using this code gives me an error of "JavaFX Application Thread" java.lang.IllegalStateException: Application launch must not be called more than once Is there anyway else that I can do this? Thanks for the helps
import javafx.event.ActionEvent;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class addstock extends Application{
public static void main(String[] args) {
launch(args);
}
public void start(Stage PrimaryStage)throws NumberFormatException {
BorderPane Bpane = new BorderPane();
FlowPane fpane = new FlowPane();
fpane.setPadding(new Insets(10));
Text title = new Text("ADD STOCK");
title.setFont(Font.font("Courier", FontWeight.EXTRA_BOLD,FontPosture.REGULAR, 22) );
Text Ttotal = new Text(" How many products to add? ");
Ttotal.setFont(new Font("Times New Roman", 16));
TextField enter = new TextField();
enter.setPrefColumnCount(3);
fpane.getChildren().addAll(title,Ttotal,enter);
fpane.setAlignment(Pos.CENTER);
Bpane.setTop(fpane);
Button btSave = new Button();
btSave.setText("Add");
btSave.setOnAction(e->
Application.launch(TVGUI.class));
fpane.getChildren().addAll(btSave);
Scene scene = new Scene(Bpane,460,400);
PrimaryStage.setTitle("Stock Deduct");
PrimaryStage.setResizable(false);
PrimaryStage.setScene(scene);
PrimaryStage.show();
}
}```