我的问题是:
当我试图导出我的小程序时,我找不到“主类”。当我双击导出的 jar 文件时,什么都没有出现,但是当我编译我的代码时它工作正常!
The code here
import java.applet.*;
import java.net.*;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.net.URL;
public class Jap_Learn extends JApplet {
AudioClip SOUND;
AudioClip SOUND1;
public void init() {
Dimension Screensize =
Toolkit.getDefaultToolkit().getScreenSize();
JFrame fr = new MainFrame();
String Serial;
Serial = JOptionPane.showInputDialog("Set serial of The prOduct");
int ISerial;
ISerial = Integer.parseInt(Serial);
if(ISerial == 47)
{fr.show();
SOUND = getAudioClip(getCodeBase(),"Music.wav");
SOUND.play();}
else
{
SOUND1 = getAudioClip(getCodeBase(),"TestSnd.wav");
SOUND1.play();
JOptionPane.showMessageDialog(null, "wrOng serial !");
}
}