NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed. (sponsored)
In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.
Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.
Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Interesting, it seems that in the most recent post-RC1 build of Vista (5728) when you run Java applications (either Swing based or SWT-based, like Eclipse) not only are the Aero/Glass effects disabled for the individual application, but completely disabled on the desktop until you close the Java application.
I ran 5728 for a few days and had NetBeans/Eclipse on it and admitedly didn't notice this but I wasn't looking for it... is anyone else running Vista and can confirm/deny this?
Re: Running Java on Vista Disabled Aero/Glass UI Effects
The Aero/Glass stuff isn't just the LNF, it's the wobbly/fading/half-transparent stuff... I was really curious where Microsoft Watch saw the situation where simply loading Java craps out all the flash-and-pizzaz in the UI.
Re: Running Java on Vista Disabled Aero/Glass UI Effects
It's related to OpenGL usage. You may need to download an OpenGL driver from Khronos that is native Vista compatible, otherwise it will an old non-Vista aware OpenGL driver which I've heard disables the Vista compositing stuff. You either have to uninstall your 3D card specific OpenGL driver and let the default MS Vista OpenGL->DirectX wrapper work, or, you need a new Vista approved OpenGL ICD.
It's not Java specific. Any OpenGL app that is windowed and not full screen will cause the problem. I think only NVidia offers a beta ICD driver for Vista that is compatible with Aero.
Re: Running Java on Vista Disabled Aero/Glass UI Effects
> It's related to OpenGL usage.
But Java normaly doesn't use OpenGL. I guess its because of the way Java uses DirectDraw ... there've been some changes to Mustang to use only GDI on Vista, since MS isn't able to keep their software compatible.
however in this case I really wonder why eclipse should disable aero, from the windows standpoint its a "native" win32 app, isn't it. Hmmm ... strange.
Re: Running Java on Vista Disabled Aero/Glass UI Effects
Oh, I though you meant Mustang which uses OpenGL as I understand it.
For older Java versions that use DirectDraw, there could be other things that cause it. Aero requires all apps to render to offscreen buffers which are then composited onto the front buffer. Any application that tries to lock the front buffer will end up disabling Aero. I also think you can't flip buffers, nor can you use overlays. Hell, getting direct access to the whole front buffer is even a security violation, considering it can be used by worms/viruses/trojans to steal info, as well as by anti-DRM ripping software.
I'm not a DirectX programmer by any means, so don't take my word for it, I'm just going by what I read in other forums. It seems if you want to do anything with the primary DirectDraw surface, you have to blit to it. I don't know how SWT works on windows, if it's 100% GDI/MFC or if it uses DirectDraw as well.
I have also read that even some GDI calls can disable Aero, like GetDC(NULL) which allows you to grab the whole desktop.
So yes, Mustang and JDK1.5 probably need an update to work nicely with Vista's DWM compositor.
EWeek saw the same thing. And you'll notice that they saw this with Azureus and Eclipse, as well as other Java apps. Basically, this means that it can't be Swing's new OpenGL pipeline since SWT doesn't use it. Also, I'm fairly sure (though it isn't stated) that EWeek would have used a stable Java release and not a 6.0 weekly build. And Java 5.0 didn't have the OpenGL pipeline (for what it's worth).
This is probably something in Vista itself since this problem doesn't occur in the older Vista betas with Swing or SWT.
> And Java 5.0 didn't have the
> OpenGL pipeline (for what it's worth).
Although its nothing worth, java-5.0 did have an opengl accalerated java2d pipeline.
> This is probably something in Vista itself since this
> problem doesn't occur in the older Vista betas with
> Swing or SWT.
I guess its one of those tries to kill java on the long term.
If you're using a recent build of Windows Vista, you may have noticed that some applications cause a dialog box to pop up which disables desktop composition when they start up.
Here’s why this happens: one of the key aspects of desktop composition is that applications never render to the front-buffer directly, instead they render to redirection surfaces in software (for GDI applications) or shared surfaces (for DX applications), which are then in turn composed to the desktop by the DWM. But if an application needs to lock the front buffer (for read-back, or some other purpose), it can do so, but that will result in disabling desktop composition. In most cases, this is OK, because the application is drawing to the entire area of the display (as is the case with full-screen games, or watching a video in full-screen mode). Unfortunately, sometimes this also happens with applications that run in windows (vs. full screen) and in those situations the DWM shuts down.
Real-world examples of when you might see this are Apple's QuickTime Player & iTunes software. When they start up, they use DirectDraw to get access to the front buffer, even though they aren’t full-screen applications. Luckily – you can work around this! Here’s how:
1. Open Quicktime preferences by selecting “Preferences” and then “QuickTime Preferences…” from the “Edit” menu in the QuickTime player application. A dialog box will pop up, with the title: “Quicktime Settings”.
2. Select the “Advanced” tab in this dialog, and in the third section from the top, called “Video” select “Safe Mode (GDI Only)”
3. Close the QuickTime player, and exit the QuickTime system tray application as well
The next time you start iTunes or QuickTime, it will use GDI to present its content instead of DirectDraw, which will work in a way that is more compatible with desktop composition. Most other applications that use DirectDraw have a fallback path to use GDI that you can find if you look in the options for the application itself.
So if you have a an application that uses DirectDraw and you don't want Aero to disable when your application is in use, the best way to do this is to adjust your code so that you're sticking to using DirectDraw's Blt methods (Blt, BltFast, etc.) to get your data into your sufraces, and make sure that you're not calling Lock or GetDC on those surfaces at any time, as these are the methods that will cause Windows to shut down composition.
Another thing to consider is using the methods in dwmapi.h to detect if composition is enabled, and automatically fall back to your GDI codepaths when starting up if you are not in a position to refactor your DirectDraw code.
"
Re: Running Java on Vista Disabled Aero/Glass UI Effects
> On disabling Aero Glass
> http://blogs.msdn.com/greg_schechter/archive/2006/05/0 > 2/588934.aspx
>
> From
> http://blogs.msdn.com/kamvedbrat/archive/2006/04/02/56 > 6788.aspx
>
> Apparently Quicktime does it too.
>
> "
>
> If you're using a recent build of Windows Vista, you
> may have noticed that some applications cause a
> dialog box to pop up which disables desktop
> composition when they start up.
>
> Here’s why this happens: one of the key aspects of
> desktop composition is that applications never render
> to the front-buffer directly, instead they render to
> redirection surfaces in software (for GDI
> applications) or shared surfaces (for DX
> applications), which are then in turn composed to the
> desktop by the DWM. But if an application needs to
> lock the front buffer (for read-back, or some other
> purpose), it can do so, but that will result in
> disabling desktop composition. In most cases, this is
> OK, because the application is drawing to the entire
> area of the display (as is the case with full-screen
> games, or watching a video in full-screen mode).
> Unfortunately, sometimes this also happens with
> applications that run in windows (vs. full screen)
> and in those situations the DWM shuts down.
>
> Real-world examples of when you might see this are
> Apple's QuickTime Player & iTunes software. When they
> start up, they use DirectDraw to get access to the
> front buffer, even though they aren’t full-screen
> applications. Luckily – you can work around this!
> Here’s how:
>
> 1. Open Quicktime preferences by selecting
> “Preferences” and then “QuickTime Preferences…” from
> the “Edit” menu in the QuickTime player application.
> A dialog box will pop up, with the title: “Quicktime
> Settings”.
> 2. Select the “Advanced” tab in this dialog, and in
> the third section from the top, called “Video”
> select “Safe Mode (GDI Only)”
> 3. Close the QuickTime player, and exit the
> QuickTime system tray application as well
>
> The next time you start iTunes or QuickTime, it will
> use GDI to present its content instead of DirectDraw,
> which will work in a way that is more compatible with
> desktop composition. Most other applications that use
> DirectDraw have a fallback path to use GDI that you
> can find if you look in the options for the
> application itself.
>
> So if you have a an application that uses DirectDraw
> and you don't want Aero to disable when your
> application is in use, the best way to do this is to
> adjust your code so that you're sticking to using
> DirectDraw's Blt methods (Blt, BltFast, etc.) to get
> your data into your sufraces, and make sure that
> you're not calling Lock or GetDC on those surfaces at
> any time, as these are the methods that will cause
> Windows to shut down composition.
>
> Another thing to consider is using the methods in
> dwmapi.h to detect if composition is enabled, and
> automatically fall back to your GDI codepaths when
> starting up if you are not in a position to refactor
> your DirectDraw code.
> "
Re: Running Java on Vista Disabled Aero/Glass UI Effects
All right, I see a lot of misinformation flying around.
Let me get things straight[er].
1. Releases prior to 5.0u8 indeed did not work well on Vista, disabling DWM (Aero) among many other non-gui related issues. JDK6 and 5.0u8+ work just fine on Vista.
2. The disabling of the DWM is related to the Java2D's use of DirectDraw and GDI on the same on-screen surfaces (an issue which Microsoft decided not to fix as apparently it was never supported [a fact never documented] and was finally broken on Vista)
3. It is not related to OpenGL as neither JDK5 nor JDK6 use the OpenGL pipeline by default
4. We have lots of folks making sure we work fine on Vista (including Swing L&F, rollover effects, etc). We do test both JDK5 and JDK6 on all Vista builds.
Re: Running Java on Vista Disabled Aero/Glass UI Effects
Um.. What's a clarification without further clarification.
> 2. The disabling of the DWM is related to the Java2D's use of DirectDraw and GDI on the same on-screen surfaces (an issue which Microsoft decided not to fix as apparently it was never supported [a fact never documented] and was finally broken on Vista)
Actually, the disablement of the DWM was caused by locking the on-screen surface. After that was fixed we've run into the issue described in 2.
Re: Running Java on Vista Disabled Aero/Glass UI Effects
Hi Dmitri,
I'll take your word that Swing is running well on Vista (I don't plan to use it for quite some time, anyway), however, what concerns me a bit is why the hell wouldn't Azerus, written in SWT work well on latest Vista build (which, if I understand well, should be "almost gold" release, just one build more before going gold for MS and Vista).
Running Java on Vista Disabled Aero/Glass UI Effects
URL: Microsoft Watch
At 9:01 PM on Sep 29, 2006, Riyad Kalla
wrote:
Fresh Jobs for Developers Post a job opportunity
I ran 5728 for a few days and had NetBeans/Eclipse on it and admitedly didn't notice this but I wasn't looking for it... is anyone else running Vista and can confirm/deny this?
31 replies so far (
Post your own)
Re: Running Java on Vista Disabled Aero/Glass UI Effects
You mean this?http://wiki.netbeans.info/wiki/view/NewAndNoteWorthy
Re: Running Java on Vista Disabled Aero/Glass UI Effects
The Aero/Glass stuff isn't just the LNF, it's the wobbly/fading/half-transparent stuff... I was really curious where Microsoft Watch saw the situation where simply loading Java craps out all the flash-and-pizzaz in the UI.Re: Running Java on Vista Disabled Aero/Glass UI Effects
It's related to OpenGL usage. You may need to download an OpenGL driver from Khronos that is native Vista compatible, otherwise it will an old non-Vista aware OpenGL driver which I've heard disables the Vista compositing stuff. You either have to uninstall your 3D card specific OpenGL driver and let the default MS Vista OpenGL->DirectX wrapper work, or, you need a new Vista approved OpenGL ICD.It's not Java specific. Any OpenGL app that is windowed and not full screen will cause the problem. I think only NVidia offers a beta ICD driver for Vista that is compatible with Aero.
Re: Running Java on Vista Disabled Aero/Glass UI Effects
> It's related to OpenGL usage.But Java normaly doesn't use OpenGL. I guess its because of the way Java uses DirectDraw ... there've been some changes to Mustang to use only GDI on Vista, since MS isn't able to keep their software compatible.
however in this case I really wonder why eclipse should disable aero, from the windows standpoint its a "native" win32 app, isn't it. Hmmm ... strange.
lg Clemens
Re: Running Java on Vista Disabled Aero/Glass UI Effects
Oh, I though you meant Mustang which uses OpenGL as I understand it.For older Java versions that use DirectDraw, there could be other things that cause it. Aero requires all apps to render to offscreen buffers which are then composited onto the front buffer. Any application that tries to lock the front buffer will end up disabling Aero. I also think you can't flip buffers, nor can you use overlays. Hell, getting direct access to the whole front buffer is even a security violation, considering it can be used by worms/viruses/trojans to steal info, as well as by anti-DRM ripping software.
I'm not a DirectX programmer by any means, so don't take my word for it, I'm just going by what I read in other forums. It seems if you want to do anything with the primary DirectDraw surface, you have to blit to it. I don't know how SWT works on windows, if it's 100% GDI/MFC or if it uses DirectDraw as well.
I have also read that even some GDI calls can disable Aero, like GetDC(NULL) which allows you to grab the whole desktop.
So yes, Mustang and JDK1.5 probably need an update to work nicely with Vista's DWM compositor.
It isn't just Swing...
http://www.microsoft-watch.com/article2/0,2180,2022483,00.aspEWeek saw the same thing. And you'll notice that they saw this with Azureus and Eclipse, as well as other Java apps. Basically, this means that it can't be Swing's new OpenGL pipeline since SWT doesn't use it. Also, I'm fairly sure (though it isn't stated) that EWeek would have used a stable Java release and not a 6.0 weekly build. And Java 5.0 didn't have the OpenGL pipeline (for what it's worth).
This is probably something in Vista itself since this problem doesn't occur in the older Vista betas with Swing or SWT.
ActiveObjects: an Easier Java ORM; Fuse: Resource Injection for Java
Re: It isn't just Swing...
> And Java 5.0 didn't have the> OpenGL pipeline (for what it's worth).
Although its nothing worth, java-5.0 did have an opengl accalerated java2d pipeline.
> This is probably something in Vista itself since this
> problem doesn't occur in the older Vista betas with
> Swing or SWT.
I guess its one of those tries to kill java on the long term.
lg Clemens
Re: Running Java on Vista Disabled Aero/Glass UI Effects
On disabling Aero Glasshttp://blogs.msdn.com/greg_schechter/archive/2006/05/02/588934.aspx
From http://blogs.msdn.com/kamvedbrat/archive/2006/04/02/566788.aspx
Apparently Quicktime does it too.
"
If you're using a recent build of Windows Vista, you may have noticed that some applications cause a dialog box to pop up which disables desktop composition when they start up.
Here’s why this happens: one of the key aspects of desktop composition is that applications never render to the front-buffer directly, instead they render to redirection surfaces in software (for GDI applications) or shared surfaces (for DX applications), which are then in turn composed to the desktop by the DWM. But if an application needs to lock the front buffer (for read-back, or some other purpose), it can do so, but that will result in disabling desktop composition. In most cases, this is OK, because the application is drawing to the entire area of the display (as is the case with full-screen games, or watching a video in full-screen mode). Unfortunately, sometimes this also happens with applications that run in windows (vs. full screen) and in those situations the DWM shuts down.
Real-world examples of when you might see this are Apple's QuickTime Player & iTunes software. When they start up, they use DirectDraw to get access to the front buffer, even though they aren’t full-screen applications. Luckily – you can work around this! Here’s how:
1. Open Quicktime preferences by selecting “Preferences” and then “QuickTime Preferences…” from the “Edit” menu in the QuickTime player application. A dialog box will pop up, with the title: “Quicktime Settings”.
2. Select the “Advanced” tab in this dialog, and in the third section from the top, called “Video” select “Safe Mode (GDI Only)”
3. Close the QuickTime player, and exit the QuickTime system tray application as well
The next time you start iTunes or QuickTime, it will use GDI to present its content instead of DirectDraw, which will work in a way that is more compatible with desktop composition. Most other applications that use DirectDraw have a fallback path to use GDI that you can find if you look in the options for the application itself.
So if you have a an application that uses DirectDraw and you don't want Aero to disable when your application is in use, the best way to do this is to adjust your code so that you're sticking to using DirectDraw's Blt methods (Blt, BltFast, etc.) to get your data into your sufraces, and make sure that you're not calling Lock or GetDC on those surfaces at any time, as these are the methods that will cause Windows to shut down composition.
Another thing to consider is using the methods in dwmapi.h to detect if composition is enabled, and automatically fall back to your GDI codepaths when starting up if you are not in a position to refactor your DirectDraw code.
"
Re: Running Java on Vista Disabled Aero/Glass UI Effects
> On disabling Aero Glass> http://blogs.msdn.com/greg_schechter/archive/2006/05/0
> 2/588934.aspx
>
> From
> http://blogs.msdn.com/kamvedbrat/archive/2006/04/02/56
> 6788.aspx
>
> Apparently Quicktime does it too.
>
> "
>
> If you're using a recent build of Windows Vista, you
> may have noticed that some applications cause a
> dialog box to pop up which disables desktop
> composition when they start up.
>
> Here’s why this happens: one of the key aspects of
> desktop composition is that applications never render
> to the front-buffer directly, instead they render to
> redirection surfaces in software (for GDI
> applications) or shared surfaces (for DX
> applications), which are then in turn composed to the
> desktop by the DWM. But if an application needs to
> lock the front buffer (for read-back, or some other
> purpose), it can do so, but that will result in
> disabling desktop composition. In most cases, this is
> OK, because the application is drawing to the entire
> area of the display (as is the case with full-screen
> games, or watching a video in full-screen mode).
> Unfortunately, sometimes this also happens with
> applications that run in windows (vs. full screen)
> and in those situations the DWM shuts down.
>
> Real-world examples of when you might see this are
> Apple's QuickTime Player & iTunes software. When they
> start up, they use DirectDraw to get access to the
> front buffer, even though they aren’t full-screen
> applications. Luckily – you can work around this!
> Here’s how:
>
> 1. Open Quicktime preferences by selecting
> “Preferences” and then “QuickTime Preferences…” from
> the “Edit” menu in the QuickTime player application.
> A dialog box will pop up, with the title: “Quicktime
> Settings”.
> 2. Select the “Advanced” tab in this dialog, and in
> the third section from the top, called “Video”
> select “Safe Mode (GDI Only)”
> 3. Close the QuickTime player, and exit the
> QuickTime system tray application as well
>
> The next time you start iTunes or QuickTime, it will
> use GDI to present its content instead of DirectDraw,
> which will work in a way that is more compatible with
> desktop composition. Most other applications that use
> DirectDraw have a fallback path to use GDI that you
> can find if you look in the options for the
> application itself.
>
> So if you have a an application that uses DirectDraw
> and you don't want Aero to disable when your
> application is in use, the best way to do this is to
> adjust your code so that you're sticking to using
> DirectDraw's Blt methods (Blt, BltFast, etc.) to get
> your data into your sufraces, and make sure that
> you're not calling Lock or GetDC on those surfaces at
> any time, as these are the methods that will cause
> Windows to shut down composition.
>
> Another thing to consider is using the methods in
> dwmapi.h to detect if composition is enabled, and
> automatically fall back to your GDI codepaths when
> starting up if you are not in a position to refactor
> your DirectDraw code.
> "
Wow! Major Vista guru here!
ActiveObjects: an Easier Java ORM; Fuse: Resource Injection for Java
Re: Running Java on Vista Disabled Aero/Glass UI Effects
Did anyone try running the VM on Vista with -Dsun.java2d.noddraw=true?Re: Running Java on Vista Disabled Aero/Glass UI Effects
All right, I see a lot of misinformation flying around.Let me get things straight[er].
1. Releases prior to 5.0u8 indeed did not work well on Vista, disabling DWM (Aero) among many other non-gui related issues. JDK6 and 5.0u8+ work just fine on Vista.
2. The disabling of the DWM is related to the Java2D's use of DirectDraw and GDI on the same on-screen surfaces (an issue which Microsoft decided not to fix as apparently it was never supported [a fact never documented] and was finally broken on Vista)
3. It is not related to OpenGL as neither JDK5 nor JDK6 use the OpenGL pipeline by default
4. We have lots of folks making sure we work fine on Vista (including Swing L&F, rollover effects, etc). We do test both JDK5 and JDK6 on all Vista builds.
Thanks,
Dmitri
Java2D Team
Re: Running Java on Vista Disabled Aero/Glass UI Effects
Um.. What's a clarification without further clarification.> 2. The disabling of the DWM is related to the Java2D's use of DirectDraw and GDI on the same on-screen surfaces (an issue which Microsoft decided not to fix as apparently it was never supported [a fact never documented] and was finally broken on Vista)
Actually, the disablement of the DWM was caused by locking the on-screen surface. After that was fixed we've run into the issue described in 2.
Dmitri
Re: Running Java on Vista Disabled Aero/Glass UI Effects
Hi Dmitri,I'll take your word that Swing is running well on Vista
Re: Running Java on Vista Disabled Aero/Glass UI Effects
Indeed. Since the Swing classes aren't even *touched* by Azureus, I think it's safe to say that something else is going on here...Of course, there's the obvious possibility that SWT is also triggering the Aero shutdown, which would *really* stink.
ActiveObjects: an Easier Java ORM; Fuse: Resource Injection for Java