frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
waitD.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// save!
final int filter = 0; // 0 - no filter; 1 - sub; 2 - up
final int compressionLevel = 9; // 0 to 9 with 0 being no compression
final PngEncoder png = new PngEncoder(bv.getEntireBoardImage(),
PngEncoder.NO_ALPHA, filter, compressionLevel);
try {
final 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);
}