Commit 915b24de authored by Bradley Richards's avatar Bradley Richards
Browse files

Merge branch 'master' of

parents 47cacbf8 ef031a28
package ch.fhnw.richards.lecture08_JavaFX_advanced.MouseDetector;
import javafx.application.Application;
import javafx.stage.Stage;
public class MouseDetector extends Application {
private MouseDetector_View view;
private MouseDetector_Controller controller;
private MouseDetector_Model model;
public static void main(String[] args) {
* Note the dependencies between model, view and controller. Additionally,
* the view needs the primaryStage created by JavaFX.
public void start(Stage primaryStage) {
// Initialize the GUI
model = new MouseDetector_Model();
view = new MouseDetector_View(primaryStage, model);
controller = new MouseDetector_Controller(model, view);
// Display the GUI after all initialization is complete
package ch.fhnw.richards.lecture08_JavaFX_advanced.MouseDetector;
public class MouseDetector_Controller {
final private MouseDetector_Model model;
final private MouseDetector_View view;
protected MouseDetector_Controller(MouseDetector_Model model, MouseDetector_View view) {
this.model = model;
this.view = view;
// Add your code here !!!
package ch.fhnw.richards.lecture08_JavaFX_advanced.MouseDetector;
public class MouseDetector_Model {
protected MouseDetector_Model() {
// Empty - no model for this example
package ch.fhnw.richards.lecture08_JavaFX_advanced.MouseDetector;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
public class MouseDetector_View {
private MouseDetector_Model model;
private Stage stage;
protected Label lblDetector;
protected MouseDetector_View(Stage stage, MouseDetector_Model model) {
this.stage = stage;
this.model = model;
stage.setTitle("Mouse Detector");
GridPane root = new GridPane();
lblDetector = new Label("This is a label");
lblDetector.setMinSize(200, 200);
root.add(lblDetector, 0, 0);
Scene scene = new Scene(root);
public void start() {;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment