是不是你在applet里面new 了新的窗口出来啊?比如frame或者window之类的?
applet本来就是嵌入在页面

解决方案 »

  1.   

    没错,是new了新的窗口,如:JPanel,JLabel之类的东西!是这个原因吗?
      

  2.   

    对啊,用了Frame,
    但我必须要用到他,难道这样就不能完全嵌入到页面中吗?
      

  3.   

    只有applet 是嵌在也面的
    你可以把frame 里的元素移到applet 中
      

  4.   

    你可以把frame  里的元素移到applet中
    applet继承了JFrame,不知道你所说的把frame  里的元素移到applet中是什么意思?
      

  5.   

    就是把加到jframe窗口的所有东西都改为加到applet,将这个jframe去掉
    比如jframe.getContentPane().add(jlabel);改为applet.getContentPane().add(jlabel)
      

  6.   


    // 这是一个构造主窗口框架的文件acView.java
    public class acView extends JFrame {

    /*
     * 定义需要用到的对象、变量
     */
    private Container pane;
    private JSplitPane splitPaneLR;//左右分隔
    private JSplitPane splitPaneUD;//上下分隔

    private JScrollPane scrollPaneMain;//内容窗格

    //以下两种方式可选
    //private JTextArea msgTextArea;//显示消息的文本区
    private UIAlarmMsgTable msgTable;//显示告警信息的表格区域
             ......
             ......
             public static void main(String[] args) { ShowMapThread.getInstance().start();

    UIMainPanel.getInstance().requestFocus();

    }
    }//以下是Applet文件 acViewApplet.javapublic final class acViewApplet extends JApplet{

    // Image image; /* 初始化该applet小应用程序,加载必须的类
     * @see java.applet.Applet#init()
     */
    private UIAlarmMsgTable msgTable;//显示告警信息的表格区域 private JMenuBar uimb;//主菜单
    private JTree uit;//区域设备树
    private UIToolBar uitb;//工具栏
    private JSplitPane splitPaneUD;//上下分隔

    public void init(){
    this.setSize(640,480);
    acView acview=acView.getInstance();
    Container pane = this.getContentPane();
    Image titleIcon;
    titleIcon=((ImageIcon)(IconFactory.getIcon(Device.FIBNET,
    "swetness.gif"))).getImage(); acview.setIconImage(titleIcon);

    //加上主菜单
    uimb=UIMenuBar.getInstance();
    setJMenuBar(uimb); //加上工具栏
    uitb=UIToolBar.getInstance();
    pane.add(BorderLayout.NORTH,uitb); //上下分隔显示面板
    splitPaneUD = acview.getSplitPaneUD();
    pane.add(BorderLayout.CENTER, splitPaneUD);
    acView.main(null);
    }
    }
      

  7.   

    你将acView改成从Object继承
    public class acView {
    }