add welcomePageController

This commit is contained in:
Mateusz Kowalczyk 2019-11-22 22:14:44 +01:00
parent c1ffeb1b66
commit f3cd4ac29d
4 changed files with 18 additions and 23 deletions

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<VBox prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<children>
<AnchorPane maxHeight="-1.0" maxWidth="-1.0" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS">
<children>
<Label alignment="CENTER" layoutX="155.0" layoutY="177.0" style="&#10;" text="Welcome in Friend Face Matcher" textAlignment="CENTER" textFill="#9f9f9f" wrapText="false">
<font>
<Font size="18.0" />
</font>
</Label>
</children>
</AnchorPane>
</children>
</VBox>

View File

@ -6,7 +6,6 @@ import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.File;
import java.net.URL;
public class Main extends Application {
@ -14,7 +13,7 @@ public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
URL welcomePageUrl = ClassLoader.getSystemClassLoader().
getResource("welcomePage.fxml");
getResource("resource/welcomePage.fxml");
Parent welcomePage = FXMLLoader.load(welcomePageUrl);
primaryStage.setTitle("Friend Face Matcher");

View File

@ -0,0 +1,14 @@
package application.controller;
import javafx.fxml.FXML;
public class WelcomePageController {
public WelcomePageController() {
System.out.println("Controller work");
}
@FXML
public void startNewApp(){
System.out.println("Button work");;
}
}

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<VBox prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<VBox prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.controller.WelcomePageController">
<children>
<AnchorPane maxHeight="-1.0" maxWidth="-1.0" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS">
<children>
@ -14,6 +15,7 @@
<Font size="18.0" />
</font>
</Label>
<Button alignment="CENTER" layoutX="263.0" layoutY="212.0" mnemonicParsing="false" onAction="#startNewApp" text="Let's start" />
</children>
</AnchorPane>
</children>