Guest User

Untitled

a guest
Jan 17th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. public ComboBox<Person> aComboBox;
  2.  
  3. aComboBox.getItems().addAll(People.getPeople());
  4. aComboBox.getItems().add(new Person("Add New...", ""))
  5.  
  6. public void aComboBox() throws IOException {
  7. if (aComboBox.getValue().getFirstname() == "Add New...") {
  8. Parent AnotherView= FXMLLoader.load(getClass().getResource("AnotherView.fxml"));
  9. Stage Window = new Stage();
  10. Window.initModality(Modality.APPLICATION_MODAL);
  11. Window.setScene(new Scene(BillingView));
  12. Window.show();
  13. }
  14. }
  15.  
  16. public void aComboBox() throws IOException {
  17. if (aComboBox.getValue().getFirstname() == "Add New...") {
  18. aComboBox.setValue(null);
  19. Parent AnotherView= FXMLLoader.load(getClass().getResource("AnotherView.fxml"));
  20. Stage Window = new Stage();
  21. Window.initModality(Modality.APPLICATION_MODAL);
  22. Window.setScene(new Scene(BillingView));
  23. Window.show();
  24. }
  25. }
Add Comment
Please, Sign In to add comment