diff --git a/controller/RootLayout.java b/controller/RootLayout.java index 14aff6e..29c6f2d 100644 --- a/controller/RootLayout.java +++ b/controller/RootLayout.java @@ -49,6 +49,8 @@ public class RootLayout extends Application implements EventObserver { /* (1) store primary stage + title it */ this.root_stage = primary_stage; this.root_stage.setTitle("Language learner pro plus 2000"); + + setUserAgentStylesheet(STYLESHEET_CASPIAN); /* (2) Load the root layout*/ this.loadRootLayout(); @@ -254,15 +256,25 @@ public class RootLayout extends Application implements EventObserver { } public void handleMainLayoutChange(String layout) { - FlowPane container = (FlowPane) this.root_layout.lookup("#container"); - container.getChildren().clear(); + this.main_container.getChildren().clear(); switch(layout) { case "dictionary" : - container.getChildren().add(new Text("dictionary")); + this.main_container.getChildren().add(new Text("dictionary")); break; case "exercises" : - container.getChildren().add(new Text("exercises")); + /* (1) Load the root_disp.fxml */ + FXMLLoader loader = new FXMLLoader(); + + loader.setLocation(getClass().getResource("/fxml/vocabulary_disp.fxml")); + + /* (2) Load the layout into the scene */ + try { + this.main_container.getChildren().add((AnchorPane) loader.load()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } break; case "translator" : this.root_layout.lookup("#submenu").setVisible(false); diff --git a/fxml/vocabulary_disp.fxml b/fxml/vocabulary_disp.fxml index 2516acc..dc95273 100644 --- a/fxml/vocabulary_disp.fxml +++ b/fxml/vocabulary_disp.fxml @@ -1,70 +1,54 @@ - - + + + - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -