public static WaitDialog showDialog(WaitDialog.Runnable runnable,String message,Container container,int width,int height){
  WaitDialog newDialog=null;
  if (container instanceof JDialog) {
    newDialog=new WaitDialog((JDialog)container);
  }
 else   if (container instanceof JFrame) {
    newDialog=new WaitDialog((JFrame)container);
  }
 else {
    newDialog=new WaitDialog((JDialog)null);
    newDialog.setLocationRelativeTo(container);
  }
  newDialog.buildDialog(width,height);
  runnable.setDialog(newDialog);
  newDialog.container=container;
  newDialog.runnable=runnable;
  newDialog.setMessage(message);
  Thread processThread=new ProcessThread(newDialog);
  processThread.start();
  while (!newDialog.isVisible()) {
    try {
      Thread.sleep(100);
    }
 catch (    InterruptedException ie) {
    }
  }
  return newDialog;
}

public static WaitDialog showDialog ( WaitDialog . Runnable runnable , String message , Container container , int width , int height ) { WaitDialog newDialog = null ; if ( container instanceof JDialog ) { newDialog = new WaitDialog ( ( JDialog ) container ) ; } else if ( container instanceof JFrame ) { newDialog = new WaitDialog ( ( JFrame ) container ) ; } else { newDialog = new WaitDialog ( ( JDialog ) null ) ; newDialog . setLocationRelativeTo ( container ) ; } newDialog . buildDialog ( width , height ) ; runnable . setDialog ( newDialog ) ; newDialog . container = container ; newDialog . runnable = runnable ; newDialog . setMessage ( message ) ; Thread processThread = new ProcessThread ( newDialog ) ; processThread . start ( ) ; while ( ! newDialog . isVisible ( ) ) { try { Thread . sleep ( 100 ) ; } catch ( InterruptedException ie ) { } } return newDialog ; }
will display message in a modal jdialog while in the run method of runnable . will set the location of the jdialog relative to container
