JFrame is a top-level container. So is JApplet. Everything has to be contained in either one or the other.
http://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html There is an article that shows how to make a next-to-top level container that can be dropped into either, so you don't have to do a lot of "duplicate" coding at the top. It's somewhere in the "deployment" section of the tutorials, but I have to run and can't track it down right now. Sorry.
[EDIT: I'm back. I found this link
http://docs.oracle.com/javase/tutorial/deployment/applet/developingApplet.html which makes a reference to making a top-level JPanel. This isn't the article I remember, but this is pretty much the idea, that either the JFrame or the JApplet can display the same JPanel.
By the way, a jar file can contain both a JFrame and a JApplet, but only one or the other gets invoked when you run the program. In other words, if you have a class with a main() in it, but you use the html to open the jar, you would address the JApplet (or subclass) not the class with the main().]