14.1.09

Splash Screen With Java Programming


package com.rangga.aplikasipenjualan;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.LineBorder;

public class SalesSplash extends JWindow
{
private JLabel lblJudul = new JLabel("Aplikasi penjualan menggunakan JAVA");
private JLabel lblImage = new JLabel(new ImageIcon("D:/Image/Icon/Icon.jpg"));
private JProgressBar progress;
private Timer timer;
int time=0;
private Dimension d = Toolkit.getDefaultToolkit().getScreenSize();

public SalesSplash()
{
Container konten = getContentPane();
konten.setBackground(new Color(75,0,50));

lblJudul.setFont(new Font("Times New Roman",Font.BOLD,20));
lblJudul.setForeground(Color.white);
lblJudul.setHorizontalAlignment(SwingConstants.CENTER);

konten.add(lblJudul,BorderLayout.NORTH);

lblImage.setBorder(new LineBorder(Color.white,1));
konten.add(lblImage,BorderLayout.CENTER);

progress = new JProgressBar(0,50);
progress.setValue(0);
progress.setStringPainted(true);
progress.setPreferredSize(new Dimension(150,20));

konten.add(progress,BorderLayout.SOUTH);

timer = new Timer(100,new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
time++;
progress.setValue(time);
double batas = progress.getPercentComplete();

if(batas == 1.0)
{
timer.stop();
progress.setValue(progress.getMinimum());
setVisible(false);
dispose();
}
}
});

timer.start();
pack();
setSize(d.width/2-getWidth()/2,d.height/2-getHeight()/2);
setLocation(d.width/2-getWidth()/2,d.height/2-getHeight()/2);
setVisible(true);

}

public static void main(String[]args)
{
new SalesSplash();
}
}

HTML Tips

Properties and marquee value of the tag is often used:

1.onmouseover = "this.stop ()";
2.onmouseout = "this.start ()";
3.direction = "up", "down", "right", "left";
4.behavior = "alternate";
5.scrollamount = "20", 20 is the value we can change as you wish;
6.width = "", the value that can be filled empty suit;
7.height = "", the value that can be filled empty suit;

24.12.08

WELCOME TO RANGGA PRASETYA BLOG!!

Wednesday, December 24, 2008

11:15 hours this morning, I start early to create a blog, enough fun, easy addition, we call for the creative imagination, and so we see how the blog interesting and fun to visit ..