• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Double Buffering help!

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx guys I got the buffer working now. Your help was much appreciated
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic