Java applet - double buffering?

Sharky Forums


Results 1 to 2 of 2

Thread: Java applet - double buffering?

  1. #1
    Tiger Shark
    Join Date
    Oct 2000
    Location
    Erie, PA, USA
    Posts
    693

    Java applet - double buffering?

    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.
    AMD AthlonXP 2600+ Thoroughbred B @ 200x10.5
    Shuttle AN35N nForce2 Ultra 400
    2x512MB Kingston PC3200 (3-3-3)
    ATI Radeon 9600 Pro
    40GB WD ATA-100 8MB cache
    Creative 12X DVD Drive
    Memorex 52X CD-RW
    Running Windows XP Pro

  2. #2
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    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.
    Last edited by rock; 04-21-2003 at 08:48 AM.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •