hello friend this is the code of my splash screen i want to play a background music when this screen is appears who can i do that i have "hbd.au" file.which i want to play at back ground.I also want to stop the music when it end i.e recursive playback must not happen.
And i also want to know which type of music file can i use at background.
Here is the code of splash screen
import java.awt.*;
import javax.swing.*;
public class bdrsplash extends JWindow implements Runnable
{
Thread t;
Image i;
ImageIcon ii;
int x = 0;
bdrsplash()
{
t = new Thread( this, "hhh" );
ii = new ImageIcon( "bdr.png" );
i = ii.getImage();
setBounds( 150, 150, 640, 480 );
setVisible( true );
t.start();
}
public void run()
{
try
{
while( x < 600)
{
x += 5;
t.sleep( 100 );
repaint();
}
t.sleep( 500 );
}catch( Exception e ){}
//this.setVisible( false );
this.dispose();
//call to the other class
mainscreen me = new mainscreen();
me.setSize(300,300);
me.setVisible(true);
}
public void paint( Graphics g )
{
g.drawImage( i, 0, 0, this );
g.setColor( Color.BLACK );
g.drawString( ( x * 100 ) / 600 + "%", 588, 442 );
g.fillRect( 23,428, x, 20 );
}
public static void main( String args[] )
{
new bdrsplash();
}
}
Thanx.And have a good day!