/**
* @(#)SplashScreen.java
*
* @author syafi'i jauhari
* @auraipank.blogspot.com
* @version 1.00 2009/5/12
*/
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.LineBorder;
class SplashScreen extends JWindow
{
private Dimension d1 = Toolkit.getDefaultToolkit().getScreenSize();
private JLabel jlogo = new JLabel(new ImageIcon("picture/Background.jpg"));
private JProgressBar pb1 = new JProgressBar();
private int time1 = 0 ;
private Timer timer1;
public SplashScreen ()
{
Color Warna = Color.blue;
pb1.setValue(0);
pb1.setPreferredSize(new Dimension(100,15));
pb1.setBackground(Color.white);
pb1.setForeground(Color.red);
pb1.setStringPainted(true);
pb1.setBorder(new LineBorder(Warna,1));
jlogo.setBorder(new LineBorder(Warna,1));
getContentPane().add(jlogo,BorderLayout.NORTH);
getContentPane().add(pb1,BorderLayout.CENTER);
timer1 = new Timer(50,new ActionListener()
{
public void actionPerformed(ActionEvent evt)
{
time1++;
pb1.setValue(time1);
if (pb1.getPercentComplete()==1.0)
{
timer1.stop();
setVisible(false);
//new Utama();
}
}
});
timer1.start();pack();
setLocation(d1.width/2 - getWidth()/2,d1.height/2 - getHeight()/2);
show();
}
public static void main (String[] args)
{
new SplashScreen();
}
}
Minggu, 17 Mei 2009
Splash Screen
Diposting oleh Jouhari di 8:56:00 AM 0 komentar
Label: Arsip java (newbi)
Senin, 04 Mei 2009
Ujian PBO v3
/**
* @(#)GajiPegawai3.java
*
*
* @author
* @version 1.00 2009/5/4
*/
import java.io.*;
public class GajiPegawai3 {
public static void main (String[] args) throws Exception
{
BufferedReader data = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Gaji pegawai");
System.out.println("==================================");
System.out.println("");
String nama;
System.out.print("Nama Pegawai :");
nama = data.readLine();
double gaji;
System.out.print("Gaji :");
gaji=Double.parseDouble(data.readLine());
double tunj= (gaji*12.5)/100;
System.out.println("Tunjangan :"+tunj);
double ta= (gaji*2)/100;
System.out.println("Tunjangan Anak :"+ta);
double ts= (gaji*5)/100;
System.out.println("Tunjangan Istri :"+ts);
System.out.println("==================================");
double pdt= gaji+tunj+ta+ts;
System.out.println("Pendapatan :"+pdt);
System.out.println("");
double pot;
System.out.print("Potongan :");
pot=Double.parseDouble(data.readLine());
double as= (gaji*7)/100;
System.out.println("Asuransi Kesehatan :"+as);
System.out.println("==================================");
double pgr= pot+as;
System.out.println("Pengurangan :"+pgr);
System.out.println("");
System.out.println("Jadi Gaji Pokok yang diterima ");
System.out.println("==================================");
System.out.println("Pendapatan :"+pdt);
System.out.println("Pengurangan :"+pgr);
double tot= pdt+pgr;
System.out.println("Total Gaji:"+tot);
}
}
Diposting oleh Jouhari di 1:00:00 PM 1 komentar
Label: Arsip java (newbi)
Ujian PBO v2
/**
* @(#)GajiPegawai2.java
*
*
* @author
* @version 1.00 2009/5/4
*/
import java.io.*;
public class GajiPegawai2 {
public static void main (String[] args) throws Exception
{
String nama;double tot;
double gaji;double pdt;
double tunj;double pot;
double ta;double as;
double ts;double pgr;
BufferedReader data = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Gaji pegawai");
System.out.println("==================================");
System.out.println("");
System.out.print("Nama Pegawai :");
nama = data.readLine();
System.out.print("Gaji :");
gaji=Double.parseDouble(data.readLine());
tunj= (gaji*12.5)/100;
System.out.println("Tunjangan :"+tunj);
ta= (gaji*2)/100;
System.out.println("Tunjangan Anak :"+ta);
ts= (gaji*5)/100;
System.out.println("Tunjangan Istri :"+ts);
System.out.println("==================================");
pdt= gaji+tunj+ta+ts;
System.out.println("Pendapatan :"+pdt);
System.out.println("");
System.out.print("Potongan :");
pot=Double.parseDouble(data.readLine());
as= (gaji*7)/100;
System.out.println("Asuransi Kesehatan :"+as);
System.out.println("==================================");
pgr= pot+as;
System.out.println("Pengurangan :"+pgr);
System.out.println("");
System.out.println("Jadi Gaji Pokok yang diterima ");
System.out.println("==================================");
System.out.println("Pendapatan :"+pdt);
System.out.println("Pengurangan :"+pgr);
tot= pdt+pgr;
System.out.println("Total Gaji:"+tot);
}
}
Diposting oleh Jouhari di 12:59:00 PM 0 komentar
Label: Arsip java (newbi)
Ujian PBO
/**
* @(#)GajiPegawai.java
*
*
* @author
* @version 1.00 2009/5/3
*/
import java.io.*;
public class GajiPegawai {
public static void main (String[] args) throws Exception
{
BufferedReader data = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Gaji pegawai");
System.out.println("==================================");
System.out.println("");
System.out.print("Nama Pegawai :");
String nama = data.readLine();
System.out.print("Gaji :");
double gaji=Double.parseDouble(data.readLine());
double tunj= (gaji*12.5)/100;
System.out.println("Tunjangan :"+tunj);
double ta= (gaji*2)/100;
System.out.println("Tunjangan Anak :"+ta);
double ts= (gaji*5)/100;
System.out.println("Tunjangan Istri :"+ts);
System.out.println("==================================");
double pdt= gaji+tunj+ta+ts;
System.out.println("Pendapatan :"+pdt);
System.out.println("");
System.out.print("Potongan :");
double pot=Double.parseDouble(data.readLine());
double as= (gaji*7)/100;
System.out.println("Asuransi Kesehatan :"+as);
System.out.println("==================================");
double pgr= pot+as;
System.out.println("Pengurangan :"+pgr);
System.out.println("");
System.out.println("Jadi Gaji Pokok yang diterima ");
System.out.println("==================================");
System.out.println("Pendapatan :"+pdt);
System.out.println("Pengurangan :"+pgr);
double tot= pdt+pgr;
System.out.println("Total Gaji:"+tot);
}
}
Diposting oleh Jouhari di 12:58:00 PM 0 komentar
Label: Arsip java (newbi)