Look at the API for the components that are creating the error (Component and JFrame)
Namely the methods that create the error. The deprecated methods in the API should refer you to the new methods...