If you're making an applet your code shouldn't even have a JFrame variable. Instead in the init method, add your JButton to the applet's contentPane()
or to a JPanel that is added to the contentPane as just about any tutorial will tell you.
Of course this doesn't hold if you're not trying to create an applet, but if so, why would you be running it as if it were an applet. Please clarify this for us.
Edit
You ask in comment:
Thanks for the help! but what if I want to do it in Jframe way? Because I don't want to create an applet so I didn't extends Japplet or create init(). But the ide complains "you need to extends applet" Is anywhere in my code telling it I'm creating an applet? I dont want to :(
The IDE shouldn't care what type of class you're creating as long as it compiles. It's when you try to run the code that the JVM might complain that it's not an applet, if 1) you try to run it as an applet called in some HTML code, or 2) try to run it with your IDE's applet simulator. If the former, don't do it. Run it as a stand alone program. If the latter, don't do it. Tell the IDE that you're trying to run a Java program, and for both, make sure that you've got a valid main method.