What to do with getParameter() in the java code? -


i making java applet has play video file. have searched code on net gives error @ getparameter

here code...

 public void init() {          //$ system.out.println("applet.init() called");         setlayout(null);         setbackground(color.white);         panel = new panel();         panel.setlayout( null );         add(panel);         panel.setbounds(0, 0, 320, 240);          // input file name html param         string mediafile = null;         // url our media file         medialocator mrl = null;         url url = null;          // media filename info.         // applet tag should contain path         // source media file, relative 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) {         } 

here link whole code :

http://docs.oracle.com/javase/1.4.2/docs/guide/plugin/developer_guide/simpleplayerapplet.java.html

how 'invoking' applet?

it seems trying specify 'parameter' sits on local file system yet building 'applet' should invoking via html , pass 'parameter in such:

<applet code=simpleplayerapplet.class width=320 height=300> <param name="file" value="sun.avi"> </applet> 

and getparameter call should still "file". in code using before.


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -