When Windows logs off it sends a close signal to all open windows. In your example your frame (window) is ignoring that request. If you change your default close operation to DISPOSE_ON_CLOSE or EXIT_ON_CLOSE it should end the JVM properly. If not then it is indeed a bug.
The reason it works with
java is that there is an additional command prompt window. This is then closed, which causes it to end the JVM process it started.