Click to See Complete Forum and Search --> : Java applet - double buffering?


Malone
04-20-2003, 10:58 AM
I know how to double buffer Image objects in java applets, but my problem is I want to double buffer the entire Graphics context because I have an applet where the code does all the drawing, there aren't any bitmaps used. Is this possible? If so, how would I go about doing it? I've perused the Java API but I can't really seem to find anything in the Graphics or Component classes that does what I need.

rock
04-21-2003, 08:47 AM
javax.swing.JPanel is the container you're looking for - it does double buffering (by default even). But you can explicitly use the constructor JPanel jPanel = new JPanel(boolean isDoubleBuffered). If you're using Applet, you may want to move to swing and JApplet.