Initialised the LIstener in the Initilisation method instead of an onclick function
This commit is contained in:
Binary file not shown.
@@ -69,12 +69,7 @@ public class HelpController extends Controller {
|
||||
|
||||
text = new Text("Please select an option on the left side menu to display its contents.");
|
||||
textArea.getChildren().add(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the text in the TextFlow depending on which option has been selected in the TreeView.
|
||||
*/
|
||||
public void changeView() {
|
||||
treeView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
|
||||
|
||||
public void changed(ObservableValue observable, Object oldValue,
|
||||
@@ -83,7 +78,7 @@ public class HelpController extends Controller {
|
||||
String menuValue = selectedItem.getValue();
|
||||
|
||||
if ( menuValue != null ){
|
||||
textArea.getChildren().clear();
|
||||
textArea.getChildren().clear();
|
||||
if (menuValue.equals("Importing on Startup")) {
|
||||
text = new Text("Importing on Startup\n" + "You can import data from the first start up of the application." +
|
||||
"\nTo import data, select the type of data you wish to import along the bottom of the screen." +
|
||||
@@ -170,5 +165,4 @@ public class HelpController extends Controller {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,7 +34,7 @@
|
||||
<TextFlow fx:id="textArea" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="289.0" prefWidth="364.0" textAlignment="JUSTIFY" />
|
||||
</content>
|
||||
</ScrollPane>
|
||||
<TreeView fx:id="treeView" onMouseClicked="#changeView" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1">
|
||||
<TreeView fx:id="treeView" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" />
|
||||
</GridPane.margin>
|
||||
|
||||
Reference in New Issue
Block a user