You're probably familiar with Vector and Hashtable . The Collections API provides a framework that encompasses Vector , Hashtable , and several new collection classes. Also included are static utility methods in the Collections class for sorting collections, creating threadsafe versions of collections, and other common tasks. Instead of performing a comparison, as you'd hoped, you're actually assigning true to the variable b . This assignment has an overall value of true , so the if always succeeds.
Some people suggest reversing the order of the comparison, so the literal value always comes first.
Personally, I don't like how this looks, so I just muddle through the old fashioned way, making darn sure I always use a double equals when I need it. However, if the JFrame was the main window for your application, the application will not actually quit. After closing the window, users will need to hit Ctrl-C or whatever key sequence stops a running application on their particular platform. Worse, if the application was started with javaw , it will continue to run invisibly. Java SDK and JRE Confusion On Windows, you may actually have two Java environments in different places on your computer.