你的写法有点奇怪!import javax.swing.*;
import java.awt.event.*;
import java.awt.*;public class JInternalFrame extends JFrame

static JDesktopPane desktop;
public static void main(String args[])
{
JFrame frame=new JFrame("InternalFrame");
desktop=new JDesktopPane();
createFrame();
desktop.add(myframe);



frame.setContentPane(desktop);

}

static void createFrame()
{
     MyInterFrame a = new MyInterFrame();
     a.show() ; 
     desktop.add(a);
}
}
class MyInterFrame extends JInternalFrame
{
     public MyInterFrame() 
     {         setSize(300,300);
         setLocation(100,100);
     }
 
   }