aspose file tools*
The moose likes Applets and the fly likes Double Buffering help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Double Buffering help!" Watch "Double Buffering help!" New topic
Author

Double Buffering help!

Ryan Crichton
Greenhorn

Joined: Mar 12, 2006
Posts: 3
Hi, I'm new here and I need some help with an Applet that I'm writing. Its a very basic applet that I'm writing just to help myself learn more java. I'm having a problem with implementing Double Buffering. The applet just displays nothing at all, just a white screen, when I run it. Could some one plz have a look at the code and help me out. I'm sure there is something silly that I'm missing. Here's the source:



Also any general help will be appreciated as I'm sure my programming style needs work :roll: Also I haven't included any of the classes that this applet uses as I don't think that they are needed (If they are I'l post them)
Thanx in advance
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
One possible problem is initializing offscreen in the init method. There may not be any size info or graphics context available unitl the Applet has been realized, ie, made visible. The size method is deprecated, see the method detail in the Component api.
Here are some suggestions/possibilities in uncompiled pseudo–code:
Ryan Crichton
Greenhorn

Joined: Mar 12, 2006
Posts: 3
Thanx man, I'l try your suggestions as soon as I get Home (or get to a computer with Eclipse ) I'l let you know how it went as soon as I get to test it out.

Thanx for the quick responce.
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
I normally put the initialization of the off screen image and off screen graphics in the init method, but you can use the getWidth() and getHeight() methods.

Ryan Crichton
Greenhorn

Joined: Mar 12, 2006
Posts: 3
Thanx guys I got the buffer working now. Your help was much appreciated
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Double Buffering help!