noddraw setting programatically

In a number of different places, it is explicitly stated that the sun.java2d.noddraw setting to true should be done at application start up, or in the .jnlp file of a web start file, or the like. I’ve been using the

System.setProperty("sun.java2d.noddraw","true");

line in my main method, and that seems to work… Is there some reason I shouldn’t be doing this, given that most references I can find call for it to be done at the command line?

depends on where you use it I think. if you’re calling it like:


static {
  System.setProperty ...
}

I guess it should be fine. the static {} block is about as close to the command line step that you can get.

It’s fine for a normal app, but for Web Start you shouldn’t do it. That’s because the Web Start loading dialog will be rendered with DirectDraw & your call to noddraw will occur after, perhaps causing a conflict between OGL & the DIrectDraw you have already used in WebStart. See the java2D forum about this for more info - http://www.java-gaming.org/forums/index.php?topic=14092.0

Keith

Good to know. Changing that property has no effect under non-windows OSes, does it? (I presume not, since its DirectDraw, but one can never be too careful)

No effect on other OSs.

hi,

JOGLAppletLauncher would be a great place to set this property… would this be possible? (Ken?)
My unsigned “subapplet” has no access to “sun.java2d.noddraw”, but there are still some old drivers out there, which wont display jogl applets correct.

By the time the JOGLAppletLauncher runs it’s too late to set this property. We are investigating changes to the Java Plug-In to support changing this and other command-line properties.