This looks like a runtime and not compile time error. Did you change the add to getContentPane().add, which is what the error is telling you to use?
(see Using Top Level Components)