Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package gui;
- import application.model.Conference;
- import application.model.Hotel;
- import application.model.HotelAddOn;
- import javafx.geometry.Insets;
- import javafx.scene.control.Button;
- import javafx.scene.control.Label;
- import javafx.scene.control.ListView;
- import javafx.scene.layout.GridPane;
- import javafx.scene.layout.HBox;
- import gui.conferencePopup;
- public class ConferenceWindow extends GridPane {
- private ListView<Conference> Conferences = new ListView<>();
- private ListView<HotelAddOn> addOns = new ListView<>();
- private ListView<Hotel> HotelsAddet = new ListView<>();
- private ListView<Hotel> Hotels = new ListView<>();
- private Button btnmakeConference = new Button("lav Conference");
- private Button btnRemoveConference = new Button("slet conferense");
- private Button makeEx = new Button("oprat");
- private Button deliteEx = new Button("slet");
- private Button btnAddHotel = new Button("Tilføj");
- private Button deliteHotal = new Button("fjern");
- private Label LblConference = new Label("Conferences");
- private Label LblAOns = new Label("udflugter tilknyttet");
- private Label LblHotelList = new Label("Hotel liste");
- public ConferenceWindow() {
- this.setPadding(new Insets(20));
- this.setHgap(20);
- this.setVgap(20);
- this.setGridLinesVisible(false);
- this.add(Conferences, 1, 2, 1, 4);
- HBox box1 = new HBox(20);
- HBox box2 = new HBox(20);
- box1.getChildren().add(btnRemoveConference);
- box1.getChildren().add((btnmakeConference));
- box2.getChildren().add(makeEx);
- box2.getChildren().add(deliteEx);
- this.add(deliteHotal, 2, 6);
- this.add(box1, 1, 6);
- this.add(box2, 2, 3);
- this.add(LblAOns, 2, 1);
- this.add(LblConference, 1, 1);
- this.add(LblHotelList, 3, 1);
- this.add(btnAddHotel, 3, 6);
- this.add(addOns, 2, 2);
- this.add(HotelsAddet, 2, 5);
- this.add(Hotels, 3, 2, 1, 4);
- btnmakeConference.setOnAction(event -> makeConference());
- btnRemoveConference.setOnAction(event -> deliteConference());
- }
- public void makeConference() {
- conferencePopup cP = new conferencePopup();
- cP.showAndWait();
- Conferences.getItems().add(cP.getConference());
- }
- public void deliteConference() {
- Conferences.getItems().remove(Conferences.getSelectionModel().getSelectedItem());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement