Skip to content
Snippets Groups Projects
Commit ca8c412a authored by Vesa Lappalainen's avatar Vesa Lappalainen :bicyclist:
Browse files

kerho annettu konrollerille

parent 7f5189a1
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ import javafx.fxml.FXML; ...@@ -15,6 +15,7 @@ import javafx.fxml.FXML;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import kerho.Kerho;
/** /**
* Luokka kerhon käyttöliittymän tapahtumien hoitamiseksi. * Luokka kerhon käyttöliittymän tapahtumien hoitamiseksi.
...@@ -113,6 +114,8 @@ public class KerhoGUIController implements Initializable { ...@@ -113,6 +114,8 @@ public class KerhoGUIController implements Initializable {
//=========================================================================================== //===========================================================================================
// Tästä eteenpäin ei käyttöliittymään suoraan liittyvää koodia // Tästä eteenpäin ei käyttöliittymään suoraan liittyvää koodia
private Kerho kerho;
private void naytaVirhe(String virhe) { private void naytaVirhe(String virhe) {
if ( virhe == null || virhe.isEmpty() ) { if ( virhe == null || virhe.isEmpty() ) {
labelVirhe.setText(""); labelVirhe.setText("");
...@@ -187,4 +190,13 @@ public class KerhoGUIController implements Initializable { ...@@ -187,4 +190,13 @@ public class KerhoGUIController implements Initializable {
} }
} }
/**
* Astetaan käytettävä kerho
* @param kerho jota käytetään
*/
public void setKerho(Kerho kerho) {
this.kerho = kerho;
}
} }
...@@ -3,6 +3,7 @@ package fxKerho; ...@@ -3,6 +3,7 @@ package fxKerho;
import javafx.application.Application; import javafx.application.Application;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.stage.Stage; import javafx.stage.Stage;
import kerho.Kerho;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.layout.Pane; import javafx.scene.layout.Pane;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
...@@ -26,6 +27,9 @@ public class KerhoMain extends Application { ...@@ -26,6 +27,9 @@ public class KerhoMain extends Application {
primaryStage.setScene(scene); primaryStage.setScene(scene);
primaryStage.setTitle("Kerho"); primaryStage.setTitle("Kerho");
Kerho kerho = new Kerho();
kerhoCtrl.setKerho(kerho);
// Platform.setImplicitExit(false); // tätä ei kai saa laittaa // Platform.setImplicitExit(false); // tätä ei kai saa laittaa
primaryStage.setOnCloseRequest((event) -> { primaryStage.setOnCloseRequest((event) -> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment