我正在制作一个必须播放视频文件的 java 小程序。我在网上搜索了一个代码,但它给出了一个错误getParameter
这是代码...
public void init() {
//$ System.out.println("Applet.init() is called");
setLayout(null);
setBackground(Color.white);
panel = new Panel();
panel.setLayout( null );
add(panel);
panel.setBounds(0, 0, 320, 240);
// input file name from html param
String mediaFile = null;
// URL for our media file
MediaLocator mrl = null;
URL url = null;
// Get the media filename info.
// The applet tag should contain the path to the
// source media file, relative to the html page.
// Error here: Invalid media file parameter
if ((mediaFile = getParameter("C:\\Users\\asim\\Documents\\JCreator LE\\MyProjects\\SimplePlayerApplet\\src\\Movie.avi")) == null)
Fatal("Invalid media file parameter");
try {
url = new URL(getDocumentBase(), mediaFile);
mediaFile = url.toExternalForm();
} catch (MalformedURLException mue) {
}
这是整个代码的链接:
http://docs.oracle.com/javase/1.4.2/docs/guide/plugin/developer_guide/SimplePlayerApplet.java.html