The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.



Posted by Jun on September 25, 2001 at 12:01 PM

hmmm...just by returning true in isDoubleBuffered() would actually double buffer graphics for me? thought I had to actually enable it or something....I'm forced to use Panel in java.awt because the package I have to use is implemented in java.awt. I tried adding Panel into JPanel in javax.swing which already double buffers thing by default. I can't get this way to work so. I'll try overriding isDoubleBuffered.....



> > In Component of jdk1.2.2, there's a method called "isDoubleBuffered", which returns a boolean value depending whether things are doubleBuffered or not. I'm using Convas which is a subclass of Component. How do I set or enable double buffering? I've looked at all the methods and attributes and I haven't found a way to enable the double buffering. Please help!!

> > Thanks,

> > Jun

> *snip*
> isDoubleBuffered
> public boolean isDoubleBuffered()

> Returns true if this component is painted to an offscreen image ("buffer") that's copied to the screen later. Component subclasses that support double buffering should override this method to return true if double buffering is enabled.
> Returns:
> false by default
> */snip*

> well, i haven't used this option yet, but if i'm not mistaken, u would have to override this method in your subclass to return true coz it returns false by default. just add a

> public boolean isDoubleBuffered()
> {
> return true;
> }

> in your class i guess.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us