This is not true. Would have to see all of his code to know the reason. I would guess that the object that contains the method, that contains that code, is extending JFrame (or extending something...