int[] i; int[] method();
try{...}catch(e){...}finally{...}
class MyApplet extends Applet { Image im; Graphics offscreen; public void init() { ... resize(400, 500); // or whatever ... try { im = createImage(width, height); offscreen = new Graphics(im); } catch (Exception e) { // double-buffering not available offscreen = null; } } public void paintApplet(Graphics g) { ... code to paint your applet ... } public void update(Graphics g) { paint(g); } public void paint(Graphics g) { if (offscreen != null) { // double-buffering available paintApplet(offscreen); g.drawImage(im, 0, 0); } else { // no double-buffering paintApplet(g); } } public void destroy() { if (offscreen != null) { offscreen.dispose(); im.dispose(); } } }