Article View: alt.comp.lang.java-games
Article #40createImage(int,int) in places other than applets
From: Anthony Baraff
Date: Sat, 11 Dec 1999 00:00
Date: Sat, 11 Dec 1999 00:00
15 lines
1584 bytes
1584 bytes
I'm writing a game in Java and I wanted to carry out double buffering for the animation in the game. I have used createImage while working with applets it always worked just fine. The same method exists for the java.swing components. I'm trying to use a JPanel as the backdrop for the animation. I can call the createImage successfully but it always returns a null reference. So when I attempt to get a graphics object from the Image the program fails. I create the Image in the constructor of the JPanel that I am extending. Does anyone know what to do? Is this a bug in the API or am I doing something wrong. I get no exception from the createImage() call. It just always creates a null reference. Any help would be greatly appreciated. Thanks, Anthony Baraff
Technical Details
Message-ID:
<#7e$sQBR$GA.274@cpmsnbbsa05>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,78a38cb06d5481ac,start X-Google-Attributes: gid111d45,public X-Google-Thread: 113ae9,78a38cb06d5481ac,start X-Google-Attributes: gid113ae9,public X-Google-Thread: 1033cf,78a38cb06d5481ac,start X-Google-Attributes: gid1033cf,public X-Google-Thread: 10fd6d,78a38cb06d5481ac,start X-Google-Attributes: gid10fd6d,public From: "Anthony Baraff" <Anthony@chelsea-tech.com> Subject: createImage(int,int) in places other than applets Date: 1999/12/11 Message-ID: <#7e$sQBR$GA.274@cpmsnbbsa05> X-Deja-AN: 559469696 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Newsgroups: alt.comp.lang.java-games,borland.public.jbuilder.java.swing,comp.lang.java.gui,comp.lang.java.help