-
Notifications
You must be signed in to change notification settings - Fork 1
/
Animation.java
64 lines (50 loc) · 1.48 KB
/
Animation.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
package dev.roshan.baaja;
import java.awt.Color;
import java.awt.Image;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Animation
{
JFrame frmAnimate;
ImageIcon iconAnimateBaaja, iconBaajaIntro;
JLabel lblBaajaIntro;
int width = 500;
int height = 350;
public void animate()
{
frmAnimate = new JFrame();
frmAnimate.setSize(width, height);
frmAnimate.setUndecorated(true);
frmAnimate.setLayout(null);
frmAnimate.setLocationRelativeTo(null);
iconAnimateBaaja = new ImageIcon("src/assets/logo.jpeg");
Image imageAnimateBaaja = iconAnimateBaaja.getImage();
iconAnimateBaaja.setImage(imageAnimateBaaja);
frmAnimate.setIconImage(imageAnimateBaaja);
iconBaajaIntro = new ImageIcon("src/assets/main.jpg");
Image imgBaajaAnimateIntro = iconBaajaIntro.getImage();
imgBaajaAnimateIntro = imgBaajaAnimateIntro.getScaledInstance(width, height, Image.SCALE_DEFAULT);
iconBaajaIntro.setImage(imgBaajaAnimateIntro);
lblBaajaIntro = new JLabel(iconBaajaIntro);
lblBaajaIntro.setBounds(0, 0, width, height);
lblBaajaIntro.setLayout(null);
frmAnimate.getContentPane().add(lblBaajaIntro);
frmAnimate.setBackground(Color.black);
frmAnimate.setVisible(true);
new Thread()
{
public void run()
{
try
{
Beat objBaaja = new Beat();
sleep(17000);
objBaaja.init();
frmAnimate.dispose();
}
catch (Exception e) {}
}
}.start();
}//function animate() closed here
}