-
Notifications
You must be signed in to change notification settings - Fork 1
/
Busres.java
98 lines (80 loc) · 2.39 KB
/
Busres.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
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;
import java.awt.Color;
import javax.swing.BorderFactory.*;
class Busres
{
Busres()
{
JFrame f=new JFrame("Welcome to Spy Bus ");
Label top=new Label("Spy Bus Reservation");
top.setBounds(180,10,250,40);
f.add(top);
Font myFont = new Font("Vani",Font.BOLD,24);
top.setFont(myFont);
JLabel label = new JLabel();
label.setIcon(new ImageIcon("Buslogo.png"));
label.setBounds(200,45,250,200);
f.add(label);
Label date=new Label("Date:");
date.setBounds(450,60,40,30);
f.add(date);
Label datesys=new Label();
datesys.setBounds(490,60,100,30);
f.add(datesys);
Label time=new Label("Time:");
time.setBounds(450,90,40,30);
f.add(time);
Label timesys=new Label();
timesys.setBounds(490,90,100,30);
f.add(timesys);
Date d = Calendar.getInstance().getTime();
DateFormat dateFormat1 = new SimpleDateFormat("dd MMM yyyy");
String strDate1 = dateFormat1.format(d);
datesys.setText(strDate1);
Date d1 = Calendar.getInstance().getTime();
DateFormat dateFormat = new SimpleDateFormat("hh:mm");
String strDate = dateFormat.format(d1);
timesys.setText(strDate);
JButton book=new JButton(new ImageIcon("book.png"));
book.setBounds(110,200,165,50);
book.setToolTipText("New User ");
f.add(book);
book.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
f.dispose();
new Book();
}
});
JButton log=new JButton(new ImageIcon("Login.png"));
log.setBounds(320,200,165,50);
log.setToolTipText("Existing User");
f.add(log);
log.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
f.dispose();
new View();
}
});
Label copy=new Label("Copyright@SpyBusReservation 2019-20");
copy.setBounds(180,330,250,40);
f.add(copy);
Font myFont3 = new Font("Vani",Font.BOLD,12);
copy.setFont(myFont3);
f.getRootPane().setBorder(BorderFactory.createMatteBorder(4, 4, 4, 4, Color.BLACK));
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(600,405);
f.setLayout(null);
f.setVisible(true);
}
public static void main(String a[])
{
Busres obj=new Busres();
}
}