Public void onsavejpg () {
Rectangle Rect = getBounds ();
BufferedImage Image =
(Bufferedimage) CreateImage (Rect.width, Rect.Height);
Graphics g = image.getgraphics ();
Paint (g);
g.dispose ();
Try {
FileOutputStream filestream =
New FileOutputStream ("E: //Test.jpg");
JPEGIMAGEENCODER ENCODER =
JPEGCODEC.CREATEJPEGENCODER (FILESTREAM);
Encoder.encode (image);
FileStream.close ();
} catch (exception e) {
System.out.Println ("Error Saving Jpeg File!");
}
}