Hey, I don't think there is such a function that closes all windows for java. By all windows, I mean, even applications running with the "windows" system itself. (Not the applications java creates through a JAVA IDE)
I did some research and I think you may be able to do it with c++ or one of the languages in the .net framework.
Here's the link.
http://msdn.microsoft.com/en-us/library/ms724211%28v=VS.85%29.aspx