-
Notifications
You must be signed in to change notification settings - Fork 1
/
BookRoom.java
104 lines (82 loc) · 2.93 KB
/
BookRoom.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import static javafx.scene.text.Font.font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Vrinda
*/
public class BookRoom extends Application {
Stage window;
static Label roomid,roomcap,tfrom,tto,date;
static Button book;
static Text rid,rcap,stime,etime,ddate;
@Override
public void start(Stage primaryStage) throws Exception {
window=primaryStage;
Scene sc=new Scene(compiler(),300,300);
window.setScene(sc);
window.show();
}
public static BorderPane compiler(){
BorderPane bp=new BorderPane();
Text title=new Text("Booking Details");
title.setFont(Font.font("Helvetica",30));
title.setFill(Color.BLACK);
roomid=new Label("Room ID :");
roomcap=new Label("Room Capacity :");
tfrom=new Label("Time From :");
tto=new Label("Time To :");
date= new Label("Date :");
rid=new Text(RoomAvailability.myrid);
rid.setFont(Font.font("Helvetica"));
rid.setFill(Color.BROWN);
rcap=new Text(RoomAvailability.myrcap);
rcap.setFont(Font.font("Helvetica"));
rcap.setFill(Color.BROWN);
stime=new Text(RoomAvailability.mystime);
stime.setFont(Font.font("Helvetica"));
stime.setFill(Color.BROWN);
etime=new Text(RoomAvailability.myetime);
etime.setFont(Font.font("Helvetica"));
etime.setFill(Color.BROWN);
ddate=new Text(RoomAvailability.mydate);
ddate.setFont(Font.font("Helvetica"));
ddate.setFill(Color.BROWN);
GridPane gp=new GridPane();
gp.add(roomid, 1, 1);
gp.add(roomcap, 1, 2);
gp.add(tfrom, 1, 3);
gp.add(tto, 1, 4);
gp.add(date, 1, 5);
gp.add(rid, 2, 1);
gp.add(rcap, 2, 2);
gp.add(stime, 2, 3);
gp.add(etime, 2, 4);
gp.add(ddate, 2, 5);
gp.setAlignment(Pos.CENTER);
gp.setPadding(new Insets(10,10,10,10));
book=new Button("Book Room");
bp.setCenter(gp);
bp.setBottom(book);
return bp;
}
public static void main(String[] args){
launch(args);
}
}