【发布时间】:2016-06-21 22:14:57
【问题描述】:
我尝试为我的小程序创建一个 html 文件,但没有显示任何内容。
这是我的小程序的代码
public class TimeSet extends Applet{
public TimeSet(){
//set the title
frame = new JFrame();
frame.setTitle("2 hour time set");
//specify what happens when the close button is clicked
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//set main panel where all other panels will exist in
mainPanel = new JPanel(new GridLayout(4,1));
add(mainPanel);
timePanel();
ammountPanel();
durationPanel();
buttonSet();
setVisible(true);
}
这是我用于 htm 的代码
<Html>
<Head>
<Title>TimeSet</Title>
</Head>
<Body>
<Applet Code="TimeSet.class" width=200 Height=100>
</Applet>
</Body>
</Html>
我的代码有问题还是有不同的流程? html 文件与 TimeSet.class 文件位于同一文件夹中。当我运行小程序时,它工作正常
【问题讨论】:
-
根本不要使用小程序。而是使用 Java Web Start 从链接启动框架。