Languages  >>  Java

Writing an Applet with Java

Language : English Quality : High Has Audio : true Source : showmedo Media : Flash
Writing games or demos can be good fun and packaging them up as a Java Applet can be an effective way to showcase your work on a website. In this series John Montgomery demonstrates the basics of writing a Java Applet to display graphics on screen and react to user input.

Tags: Java, Applet, Screencast, Showmedo, Demo, Eclipse,     [SUGGEST  A  TAG]

Resources referenced in this screencast
  • Java
  • Applet
  • The 'Hello World' Applet - Part 1

    A demonstration of writing a very simple "hello world" applet in Java. In this ShowMeDo John demonstrates how to create a Java Applet and how to render a string of text within the applet.

    The 'Hello World' Applet - Part 2

    Expanding the on the basic "hello world" applet, John demonstrates how to receive mouse events for basic user input and shows how to use this to alter the position of objects drawn on screen.

    The 'Hello World' Applet - Part 3

    Double-buffering is a technique used to minimise flicker on the screen, by drawing to an offscreen buffer and copying the buffer to the screen in one operation. John demonstrates this technique to create a double buffered Java Applet.

    The 'Hello World' Applet - Part 4

    Animation is an essential ingredient of a good demo applet. In this ShowMeDo John demonstrates using a thread for animation.

    The 'Hello World' Applet - Part 5

    The standard Java graphics library does not contain a drawPixel method, but there are plenty of ways to render graphics at the pixel level in Java. In this ShowMeDo John makes use of a BufferedImage so that an array of integers can be used as pixels for rendering on screen.

    Mandelbrot fractal applet in grey - Part 6

    In this ShowMeDo John builds on the foundation laid previously to generate and display the Mandelbrot fractal in a Java Applet, as a further example of how to perform pixel level rendering. This video shows how to build a gray-scale Mandelbrot (colour comes later).

    Mandelbrot fractal applet in colour - Part 7

    John adds some colour to the mandelbrot fractal, which makes things look much prettier. Rather than gray, now the applet fades from black through to red in the bacground, to yellow on the edges of the fractal and white for the heart of the the fractal.

    Animated Mandelbrot fractal applet - Part 8

    Half of creating a nice interactive applet is ensuring that things at least appear to be happening. So rather than rendering the entire Mandelbrot fractal in one go, John demonstrates how it can be rendered in parts.

    Navigable Mandelbrot fractal applet - Part 9

    In this ShowMeDo John adds navigation to the applet, by clicking with the mouse. Now the user can click to move the Mandelbrot around the screen.

    Zoomable Mandelbrot fractal applet - Part 10

    For the last part in this series John demonstrates using a MouseWheelListener to allow the user to zoom in and out of the Mandelbrot fractal with a flick of the mouse wheel using the newly-defined 'zoom' method.


    Articles Realted to this Topic

    [SUGGEST  A  ARTICLE]
    Java Applet Tutorial
    This site is meant to be a quick-and-dirty introduction to writing Java applets. A set of example applets are given to be used as exercises. Feel free to download the source code herein, try it out on your own machine, and modify it