Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void start(Stage primaryStage) {
- /*
- primaryStage.setTitle("Hello World!");
- Button btn = new Button();
- btn.setText("Say 'Hello World'");
- btn.setOnAction(event -> System.out.println("Hello World!"));
- StackPane root = new StackPane();
- root.getChildren().add(btn);
- primaryStage.setScene(new Scene(root, 300, 250));
- primaryStage.show();
- */
- String url = "jdbc:postgresql://localhost:5432/cms",
- role = "postgres",
- password = "newpassword";
- try (Connection connection = DriverManager.getConnection(url, role, password)) {
- FXMLLoader loader=new FXMLLoader();
- loader.setLocation(getClass().getResource("login.fxml"));
- AnchorPane root= null;
- try {
- root = loader.load();
- } catch (IOException e) {
- e.printStackTrace();
- }
- LoginRegisterWindowCTRL ctrlfx=loader.getController();
- ctrlfx.setParticipantRepo(new ParticipantRepository(connection));
- Scene scene = new Scene(root);
- primaryStage.setScene(scene);
- primaryStage.setTitle("Main window");
- primaryStage.show();
- } catch (SQLException e) {
- System.out.println("SQLException occurred!");
- System.out.println(e.getMessage());
- }
- System.out.println("i got here");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement