Can the Applet subclass be an inner class?
If it can, I am doing something wrong.
If not, why not?

{My goal is to have one source file be both an application and an Applet.)

Here is the code
Java Code:
package com.physpics.tutorial;
import java.awt.*;
import javax.swing.*;
public class TestApp extends JPanel {
    public TestApp() {
	add(new JButton("DON'T PUSH"));
    public class TAApplet extends JApplet {
	public void init() {
	    setContentPane(new TestApp());
    public static void main(String[] args) {
	final JFrame frame = new JFrame("Test App");
	frame.setContentPane(new TestApp());
	javax.swing.SwingUtilities.invokeLater(new Runnable() {
	    public void run() {
		frame.setPreferredSize(new Dimension(150,150));
and the <applet> tag:
<applet archive='dist/Tutorial.jar' width='200' height='200' alt='A applet'
code='com/physpics/tutorial/TestApp$TAApplet' >

(Fails with and without '.class' at the end of the code attribute.)

And here the errorlog
at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Un known Source)
at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionR Source)
at Source)
Caused by: java.lang.RuntimeException: java.lang.InstantiationException: com.physpics.tutorial.TestApp$TAApplet
at sun.plugin2.applet.Plugin2Manager$ Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at Source)
Caused by: java.lang.InstantiationException: com.physpics.tutorial.TestApp$TAApplet
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
... 9 more