Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. package gui;
  2.  
  3. import application.model.Conference;
  4. import application.model.Hotel;
  5. import application.model.HotelAddOn;
  6. import javafx.geometry.Insets;
  7. import javafx.scene.control.Button;
  8. import javafx.scene.control.Label;
  9. import javafx.scene.control.ListView;
  10. import javafx.scene.layout.GridPane;
  11. import javafx.scene.layout.HBox;
  12. import gui.conferencePopup;
  13.  
  14. public class ConferenceWindow extends GridPane {
  15.  
  16. private ListView<Conference> Conferences = new ListView<>();
  17. private ListView<HotelAddOn> addOns = new ListView<>();
  18. private ListView<Hotel> HotelsAddet = new ListView<>();
  19. private ListView<Hotel> Hotels = new ListView<>();
  20.  
  21. private Button btnmakeConference = new Button("lav Conference");
  22. private Button btnRemoveConference = new Button("slet conferense");
  23. private Button makeEx = new Button("oprat");
  24. private Button deliteEx = new Button("slet");
  25. private Button btnAddHotel = new Button("Tilføj");
  26.  
  27. private Button deliteHotal = new Button("fjern");
  28.  
  29. private Label LblConference = new Label("Conferences");
  30. private Label LblAOns = new Label("udflugter tilknyttet");
  31. private Label LblHotelList = new Label("Hotel liste");
  32.  
  33. public ConferenceWindow() {
  34. this.setPadding(new Insets(20));
  35. this.setHgap(20);
  36. this.setVgap(20);
  37. this.setGridLinesVisible(false);
  38.  
  39. this.add(Conferences, 1, 2, 1, 4);
  40.  
  41. HBox box1 = new HBox(20);
  42. HBox box2 = new HBox(20);
  43.  
  44. box1.getChildren().add(btnRemoveConference);
  45. box1.getChildren().add((btnmakeConference));
  46.  
  47. box2.getChildren().add(makeEx);
  48. box2.getChildren().add(deliteEx);
  49.  
  50. this.add(deliteHotal, 2, 6);
  51. this.add(box1, 1, 6);
  52. this.add(box2, 2, 3);
  53.  
  54. this.add(LblAOns, 2, 1);
  55. this.add(LblConference, 1, 1);
  56. this.add(LblHotelList, 3, 1);
  57. this.add(btnAddHotel, 3, 6);
  58.  
  59. this.add(addOns, 2, 2);
  60.  
  61. this.add(HotelsAddet, 2, 5);
  62. this.add(Hotels, 3, 2, 1, 4);
  63.  
  64. btnmakeConference.setOnAction(event -> makeConference());
  65. btnRemoveConference.setOnAction(event -> deliteConference());
  66.  
  67. }
  68.  
  69. public void makeConference() {
  70. conferencePopup cP = new conferencePopup();
  71. cP.showAndWait();
  72. Conferences.getItems().add(cP.getConference());
  73. }
  74.  
  75. public void deliteConference() {
  76. Conferences.getItems().remove(Conferences.getSelectionModel().getSelectedItem());
  77. }
  78.  
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement