Hmm, I can't seem to spot the difference between any of the code you posted :P
Is your JFrame frame; declared outside of the main method?