How can i convert a java program in an applet?
Posted: Apr 4, 2006 8:12 AM
Advertisement
I have developed in java a program that allow to capture a screenshot and store it into a jpg file... but i need to convert this java program in an applet..This is the source code: import java.awt.AWTException; import java.awt.Robot; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.*; import javax.imageio.ImageIO; class ScreenCapture { public static void main(String args[]) throws AWTException, IOException { // capture the whole screen BufferedImage screencapture = new Robot ().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) ); File file = new File("screencapture.jpg"); ImageIO.write(screencapture, "jpg", file); } } Thanks to everybody! i am waiting for your help!