Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Java Swing and Quartz




>Brian Foster wrote:
>
>>For a school programming assignment I need to turn off double
>>buffering. However Swing double buffering can't be used, and thus
>>can't be turned off, because Quartz double buffering is used instead.
>>So the normal code doesn't work:
>>
>>RepaintManager currentManager = RepaintManager.currentManager(c);
>>currentManager.setDoubleBufferingEnabled(false);
>>
>>Have any ideas?
>
>AFAICT, your only choice is to use a platform where you can turn off
>double-buffering.
>
>Why does the assignment require you to turn double-buffering off?
>
>And are you sure they don't just require Swing's inherent double-buffering
>be turned off (and/or on)?
>
>If we knew why, or what was trying to be accomplished, we might be able to
>offer better advice. Otherwise since double-buffering isn't necessarily
>completely turn-off-able for a Java platform, your only option is to use
>one where it is.
>
> -- GG

Thanks for responding Greg!

Basically there is no purpose to the assignment, except just to see the difference between
having double buffering on and having it off. I imagine I could just run the program on
Windows. However it would be nice to know if there was a way to turn the default double buffer
off, so that way the Java Swing one would turn on. In the source for the RepaintManager there is
this method:
/**
* Create a new RepaintManager instance. You rarely call this constructor.
* directly. To get the default RepaintManager, use
* RepaintManager.currentManager(JComponent) (normally "this").
*/

public RepaintManager() {
Object dbe = java.security.AccessController.doPrivileged(
new GetPropertyAction("awt.nativeDoubleBuffering"));
boolean nativeDoubleBuffering = (dbe != null) ?
Boolean.valueOf(dbe.toString()).booleanValue() : false;
// If native doublebuffering is being used, do NOT use
// Swing doublebuffering.
doubleBufferingEnabled = !nativeDoubleBuffering;
}
So what is happening is the native double buffering is taking over the Java Swing
double buffering. I just want to turn of that native double buffering for Java windows
so I have control over whether the windows are painted using a double or single buffer.
This has basically just turned into a search as to whether such a thing can be done.

I appreciate your help!
Thanks again!!!
Brian
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.