waitD.show();
waitD.setVisible(true);
    public void boardSaveImage() {        if(curfileImage == null) {            boardSaveAsImage();            return;        }        Dialog waitD = new Dialog(this.frame, Messages.getString("BoardEditor.waitDialog.title")); //$NON-NLS-1$        waitD.add(new Label(Messages.getString("BoardEditor.waitDialog.message"))); //$NON-NLS-1$        waitD.setSize(250,130);        // move to middle of screen        waitD.setLocation(                    frame.getSize().width / 2 - waitD.getSize().width / 2,                    frame.getSize().height / 2 - waitD.getSize().height / 2);        waitD.show();        frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));        waitD.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));        // save!        int filter = 0; //0 - no filter; 1 - sub; 2 - up        int compressionLevel = 9; // 0 to 9 with 0 being no compression        PngEncoder png =  new PngEncoder( bv.getEntireBoardImage(),                                          PngEncoder.NO_ALPHA,                                          filter,                                          compressionLevel);        try {            FileOutputStream outfile = new FileOutputStream( curfileImage );            byte[] pngbytes;            pngbytes = png.pngEncode();            if (pngbytes == null) {                System.out.println("Failed to save board as image:Null image"); //$NON-NLS-1$            }            else {                outfile.write( pngbytes );            }            outfile.flush();            outfile.close();        } catch (IOException e) {            e.printStackTrace();        }        waitD.hide();        frame.setCursor(Cursor.getDefaultCursor());    }