Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
方法将JFrame附加到java中的html页面_Java - Fatal编程技术网

方法将JFrame附加到java中的html页面

方法将JFrame附加到java中的html页面,java,Java,applet很容易嵌入到html页面中,但是当我使用applet代替JFrame时,我面临许多问题。我想在html页面中直接嵌入JFrame。是否有一种方法可以在JFrame中嵌入/运行Java文件,在html页面中嵌入/运行另一个Swing组件 上次创建applet时,我在init方法中向JApplet添加了一个JPanel @Override public void init() { highScores = new MinesweeperHighScores(); high

applet很容易嵌入到html页面中,但是当我使用applet代替JFrame时,我面临许多问题。我想在html页面中直接嵌入JFrame。是否有一种方法可以在JFrame中嵌入/运行Java文件,在html页面中嵌入/运行另一个Swing组件

上次创建applet时,我在init方法中向JApplet添加了一个JPanel

@Override
public void init() {
    highScores = new MinesweeperHighScores();
    highScores.readScores();

    MinesweeperGameType gameType = MinesweeperGameTypeFactory
            .getGameType(highScores.getGameType());
    MinesweeperGameStatus gameStatus = new MinesweeperGameStatus(gameType);
    MinesweeperPanel panel = new MinesweeperPanel(gameType, gameStatus,
            highScores, this);

    add(panel.getMainPanel());
    setSize(gameType.getSize());
}

这是一个在Applet中使用swing组件的例子,我的问题也可以用这种方法解决。但我只想知道,像applet一样,是否有任何方法可以在HTML中附加JFrame。@Gayatri Thakur:我不知道有任何方法可以将JFrame附加到HTML页面。