Dimension s = new Dimension(image.getWidth(this) + 2, image.getHeight(this) + 2); dialog.setSize(s);
Dimension s = new Dimension(image.getWidth(this) + 2, image.getHeight(this) + 2); setSize(s); dialog.setLayout(new BorderLayout()); dialog.setSize(s);
   protected void initialize(ImageIcon iimage) {      image = iimage.getImage();      // if no image, return      if (image == null) {         throw new IllegalArgumentException("Image specified is invalid.");      }//      System.out.println(" here in splash ");//		MediaTracker tracker = new MediaTracker(this);//		tracker.addImage(image,0);////		try {//			tracker.waitForAll();//		}//		catch(Exception e) {//         System.out.println(e.getMessage());//		}      // create dialog window      f = new Frame();      dialog = new Window(f);      dialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));		Dimension s = new Dimension(image.getWidth(this) + 2,			image.getHeight(this) + 2);		dialog.setSize(s);      dialog.add(this);      dialog.validate();      dialog.pack();      // position splash screen      Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();      int x = (screen.width - s.width)/2;      if (x < 0) {         x = 0;      }      int y = (screen.height - s.height)/2;      if (y < 0) {         y = 0;      }      dialog.setLocation(x, y);//      try {//         Thread.sleep(1000);//      }//      catch (InterruptedException i) {//         System.out.println(" here " + i.getMessage()  );////      }   }