import java.awt.*; class Program extends Frame { Program() throws Exception { setSize(400, 300); setVisible(true); // Sleep for 3 seconds, then minimize Thread.sleep (3000); setState ( Frame.ICONIFIED ); // Sleep for 3 seconds, then restore Thread.sleep (3000); setState ( Frame.NORMAL ); // Sleep for 3 seconds, then kill window Thread.sleep (3000); setVisible (false); dispose(); // Terminate test System.exit(0); } public static void main(String args[]) throws Exception { new Program(); } }