我試着爲我的小程序創建一個html文件,但沒有出現。html不顯示爲Applet
這是代碼到我的小應用程序
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](http://stackoverflow.com/tags/java-web-start/info)從鏈接啓動框架。 –