are there any comments i could add to this?
are there any comments i could add to this?
package attendance;
import TableViewApplication.ConfirmBox;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class MainApplication extends Application {
private Stage window;
private Label companyNameLabel = new Label("CIS 111 B");
private VBox companyLoginVBox;
private Button goToUserSceneButton;
private Scene loginScene = new LoginScene().getScene();
private Scene userScene;
private Scene administratorScene;
public static void main(String[] args) {
// Lunch the application.
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
window = primaryStage;
window.setOnCloseRequest(e -> {
e.consume();
closeProgram();
} );
// Add the Scene to the Stage
window.setScene(loginScene);
// Set the stage title.
window.setTitle("Login");
window.setWidth(350);
window.setHeight(300);
//Show the window.
window.show();
}
private void closeProgram() {
boolean answer = ConfirmBox.display("Close Window", "Do you want to close ?");
if (answer)
window.close();
}
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps