img = getImage( getClass().getResource(getParameter("img")) ); tracker = new MediaTracker(this); tracker.addImage( img, MAIN_IMAGE );
if ( show ) g.drawImage( img, 0, 0, this ); else { g.drawRect( 0, 0, getSize().width-1, getSize().height-1); g.drawString( message, 20, 20 ); }
repaint(); try { tracker.waitForID( MAIN_IMAGE ); } catch( InterruptedException e) { } if ( tracker.isErrorID( MAIN_IMAGE ) ) message= "Error"; else show = true; repaint();
if ( !tracker.checkID( MAIN_IMAGE ) ) { runme = new Thread( this ); runme.start(); }
runme.stop(); runme = null;