-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDestinations.java
75 lines (51 loc) · 2.22 KB
/
Destinations.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
package TravelingSystem;
import javax.swing.*;
import java.awt.*;
public class Destinations extends JFrame implements Runnable {
Thread t1;
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10;
JLabel[] label=new JLabel[]{l1,l2,l3,l4,l5,l6,l7,l8,l9,l10};
JLabel Caption;
public void run(){
String[] text= new String[]{"JW Marriott Hotel","Madarin Oriental Hotel","Four Seasons Hotel","Raddison Blue Hotel","Classio Hotel","The Bay Club Hotel","Breeze Blow Hotel","The Taj Hotel","Happy Morning Hotel","River View Hotel"};
try{
for(int i=0;i<9;i++){
label[i].setVisible(true);
Thread.sleep(2000);
label[i].setVisible(false);
}
}catch(Exception e){
e.printStackTrace();
}
}
Destinations(){
setBounds(350,100,800,600);
Caption=new JLabel();
Caption.setBounds(50,480,1000,70);
Caption.setForeground(Color.WHITE);
Caption.setFont(new Font("Tahoma",Font.PLAIN,68));
add(Caption);
ImageIcon i1=null,i2=null,i3=null,i4=null,i5=null,i6=null,i7=null,i8=null,i9=null,i10=null;
ImageIcon[] images=new ImageIcon[]{i1,i2,i3,i4,i5,i6,i7,i8,i9,i10};
Image j1=null,j2=null,j3=null,j4=null,j5=null,j6=null,j7=null,j8=null,j9=null,j10=null;
Image[] imaged=new Image[]{j1,j2,j3,j4,j5,j6,j7,j8,j9,j10};
ImageIcon k1=null,k2=null,k3=null,k4=null,k5=null,k6=null,k7=null,k8=null,k9=null,k10=null;
ImageIcon[] kimage=new ImageIcon[]{k1,k2,k3,k4,k5,k6,k7,k8,k9,k10};
for(int i=0;i<9;i++){
images[i]=new ImageIcon(ClassLoader.getSystemResource("icons/dest"+(i+1)+".jpg"));
imaged[i]=images[i].getImage().getScaledInstance(800, 600, Image.SCALE_DEFAULT);
kimage[i] =new ImageIcon(imaged[i]);
label[i]=new JLabel(kimage[i]);
label[i].setBounds(0,0,800,600);
add(label[i]);
}
t1=new Thread(this);
t1.start();
setVisible(true);
}
public static void main(String[] args){
new Destinations();
}
}
{
}