The Artima Developer Community
Sponsored Link

Java Answers Forum
Double buffering canvas for Application

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Max Lyn

Posts: 11
Nickname: techrolla
Registered: Feb, 2003

Double buffering canvas for Application Posted: Feb 11, 2003 4:52 PM
Reply to this message Reply
Advertisement
How do I create and Image for double buffering for an application and get the Graphics for it to not be null?
I know how to double buffer in a applet so I dont know why this doesnt work. the class extends Canvas and I do something like this to make it create an Image and Graphics :

Dimension d;
Image offImage;
Graphics2D g2;

public DrawArea()
{
d = getSize();
offImage = createImage(d.width, d.height);
g2 = (Graphics2D) offImage.getGraphics();
}

but when ever it runs, it throws a null pointer exception in the init of the main, and this class, like the JFrame is trying to add it but the DrawArea class throws a null pointer exception. Please Help!!

Topic: Help! how to construct program to run in dos Previous Topic   Next Topic Topic: HTMLEditorKit FORM tag disappears after read/write

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use