The applet is not signed and may load with it data only from the host, him the HTML document which has implemented the applet uses. 1. Appletviewer ========================================================================================= 1.1. Appletviewer Browser ---------------------------- The browser must know Java. The applet lies in a HTML document. If an exclamation mark appears in the browser on the top right from the applet window, then if messages were deposited in the Java console. The Java console becomes under Windows by object menu with click by right mouse button on the Java icon in the task bar (clock range) activates. Example of a HTML document with dynamic applet production
mp3player1










1.2. Appletviewer of Java ----------------------------- windows see c:\Programme\Java\xxxxx\bin\appletviwer.exe xxxxx e.g. jdk1.6.00_25 1.3. Appletviewer of Eclipse for Java ---------------------------------------- internal viewer HTML-document automatically created Values of PARAM's must be coded, see Run Configuration Empty Value of PARAM not possible ! Try Value "-". if HTML-document in project_folder\bin\ see 1.1. (Eclipse not running). 1.4. Warnings for management of Java and HTML and browser ------------------------------------------------------------ Warning: A (time-out controled) call of a Java method need some performance of the applet ! Warning: The applet works with regard to GUI and sound with parallel working threads. This thread need separated resources and run time - also during deinstallation of the applet. Unfortunately, are Java Se and, perhaps, also MS Windows not able to realtime, so that the following problem appears: Should only 1 sound be played precisely and end directly afterwards the applet, if the sound list may receive only exactly 1 sound. or if the sound list may receive more than 1 sound, but the breaks between the titles must be big enough, so that Java and Windows also have time, around the applet in the sound part can quit. Should the break be too low, though ends the GUI of the applet within the break, but it the next is able Sound become already audibl (if automatically the next Sound may start) which is exited exactly then right in the middle, if the sound part of the applet was just quit and, besides more time needs than the break encloses. One must test the break. If becomes, however, the Close-cross of the window of the player-GUI (that of the company system how Windows uses provided cross), Java and HTML are asynchronous: Then closes the GUI of the applet, but the sound part remains active and ends when the window of the HTML document is closed or java remove the applet. Tip: The applet is always activated with chance choice of the 1st song! The control of the buttons the player occur like Random or Play etc. by configuration file of the GUI. 2. PARAM's of Applet ========================================================================================= HTML-document always in path of class-files Eclipse project_folder\bin\ Params and their standards are determined by the programmer of the applet. NAME VALUE 2.0 APPLET tag is not allowed in HTML 5 ------------------------------------------- Replace applet with OBJECT-tag, e.g. OBJECT APPLET ID="mp3playerAppletHTML" TYPE="application/x-java-applet" STYLE="visibility:hidden" CODE="mp3playerApplet.class" WIDTH="1" HEIGHT="1" use PARAM (see later) BUT - archive not allowed, so use PARAM NAME="archive" VALUE="mp3playerAppleteng.jar" - may be exists PARAM NAME="code" VALUE="mp3playerApplet.class" This attributes of object tag are not allowed in HTML 5: align archive border classid codebase codetype declare hspacce standby vspace 2.1. PARAM "GUIFile" ----------------------- Name of GUI-Conf-File without path, or empty String "" or not coded. If not given, applet use internal standard. Tip: HTML-document always in path of class-files Eclipse project_folder\bin\ GUI-Conf-File always in path of class-files Eclipse project_folder\bin\ Playlist-File always in path of class-files Eclipse project_folder\bin\ 2.2. PARAM "SoundListFile" ----------------------------- Name of Playlist-File without path, or empty String "" or not coded. If not given, applet use internal standard. Tip: HTML-document always in path of class-files Eclipse project_folder\bin\ GUI-Conf-File always in path of class-files Eclipse project_folder\bin\ Playlist-File always in path of class-files Eclipse project_folder\bin\ All soundfile have has the same path of Class-files of applet, or they places in inside subdirectory of path of Class-files of applet. Example project_folder\bin\ there class-files an playlist-file project_folder\bin\t\ there soundifles in playlist /t/mp3pl4p.mid or \t\mp3pl4p.mid but NOT project_folder\bin\ there Class an playlist-file project_folder\t\ there soundifles in playlist ../t/mp3pl4p.mid not possible or ..\t\mp3pl4p.mid not possible Tip: For Applet every path must be able to convert tu Url without error. In Java for Applet only Url permits. Exmaple http://java.sun.com/j2se/1.3/ docs/guide/collections/designfaq.html28 ../../../demo/jfc/SwingSet2/src/SwingSet2.java file:/~/calendar Path ohly without Escape-chars like %20 path-sperator used by context of windows or unix .... The applet is not signed and may load with it data only from the host, him the HTML document which has implemented the applet uses. 2.3. PARAM "GMSoundBankInternalAllowed" ------------------------------------------ Permission of the loading of the applet-internal sound bank file GM for MIDI reproduction Value "TRUE" loading permits "FALSE" loading not permits PARAM must not be given. Better to do: Java Se supports MIDI audio platonically, becomes outdated and very user-unkindly. The user has to go after every installation of Java Se (also after every update) the sound bank for MIDI once more Java provide: By hand. Moreover, the user must procure this sound bank file even by download, if he wants to use the maximum quality. However, this file changes since many years no more. The applet can be also provided with a sound bank, with applet start it is loaded, because the applet uses internal MIDI sound (sound bank file to Applet has the maximum sound quality and must lie in the CLASS path of the applet). It is better to provide the sound bank, in addition, Java, then already from that Java-run time environment is loaded. By the user by download procured sound bank with maximum quality has to go precisely under the name soundbank.gm to following places are copied by hand (namely after EVERY Java update) /jre/lib/audio Example: c:\programs\Java\jre6\lib\audio\soundbank.gm and /sdk_dir/jre/lib/audio Example: c:\programs\Java\jdk1.6.0_23\jre\lib\audio\soundbank.gm Tip: c:\Programme\Java\jre6\ was created during install of Run-Time of Java (during install of SDK of Java). Tip: c:\Programme\Java\jdk1.6.0_23\ was created during install of SDK of Java (please always install Run-time too during install of SDK). 3. Warnings for management of Java and HTML and browser ========================================================================================= Warning: A (time-out controled) call of a Java method need some performance of the applet ! Warning: The applet works with regard to GUI and sound with parallel working threads. This thread need separated resources and run time - also during deinstallation of the applet. Unfortunately, are Java Se and, perhaps, also MS Windows not able to realtime, so that the following problem appears: Should only 1 sound be played precisely and end directly afterwards the applet, if the sound list may receive only exactly 1 sound. or if the sound list may receive more than 1 sound, but the breaks between the titles must be big enough, so that Java and Windows also have time, around the applet in the sound part can quit. Should the break be too low, though ends the GUI of the applet within the break, but it the next is able Sound become already audibl (if automatically the next Sound may start) which is exited exactly then right in the middle, if the sound part of the applet was just quit and, besides more time needs than the break encloses. One must test the break. If becomes, however, the Close-cross of the window of the player-GUI (that of the company system how Windows uses provided cross), Java and HTML are asynchronous: Then closes the GUI of the applet, but the sound part remains active and ends when the window of the HTML document is closed or java remove the applet. ONLY creation and mangement of applet with JavaScript an dynamic ressources can manage the problem of ansynchron sound and GUI ! Do not use static management of applet ! Tip: The applet is always activated with chance choice of the 1st song! The control of the buttons the player occur like Random or Play etc. by configuration file of the GUI. 4. Javascript control of the applet mp3playerApplet.js =========================================================== // +++++ public functions of mp3playerApplet.js ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ----- call Java-method to first refresh player text-data, second display this data. ---------------- // init and start check of HTML-applet-instance must be activated (exactly one sometimes) // for only activity of play music see javF01b() // with end of applet the html-element only removed from html-document if user click woth mouse on element. // function javF01a(X00) // X00 pointer of HTML-Element only inside of document.body (between and <(BODY>) // ----- call Java-method to first refresh player text-data, second display this data. ---------------- // init and start check of HTML-applet-instance must be activated (exactly one sometimes) // only activity of plaing music (for all data see javF01a()) // with end of applet the html-element only removed from html-document if user click woth mouse on element. // function javF01b(X00) // X00 pointer of HTML-Element only inside of document.body (between and <(BODY>) // ----- call Java-method to first refresh player text-data, sencond get this data. ------------------- // init and start check of HTML-applet-instance must be activated (exactly one sometimes) // only activity of plaing music (for all data see javF01a()) // function javF01c(X00) // X00 kind of information to get // 0 comment(non scrolled value) // text field must not exist // 1 name of file, text field must not exist // 2 duration, text field must not exist // 3 timepos, text field must not exist // 4 timeNow, text field must not exist // 5 dateNow, text field must not exist // 6 state of player, text field must not exist // 7 Progressbar-field value in percent "0" bis "100" // Progressbar must not exist // 8 Progressbar-field text-value // Progressbar must not exist (value in percent exist) // 9 Combobox of actual markes element // Combobox must exist (otherwise always empty string) // 10 Combobox get selected stat of element // "0" nothing is selected, "1" element is selected // Combobox must exist (otherwise always "0") // 11 Spinner value, Spinner must exist (otherwise always "0") // 12 state of play "0" silence, "1" musik active // 13 Applet-Java-instance not exist ? // "0" exist, "1" not exist // if "0" end of player ist not important // if "1" player ist not active // returns a empty string in case of error // ----- call Java-method to first refresh player text-data, sencond get this data. ------------------- // init and start check of HTML-applet-instance must be activated (exactly one sometimes) // only applet exist AND OR player ended ? function javF01d() // same like javF01c(13)=="0"; // returns 0 if applet not exist // 1 if applet exist // 2 if applet exist and player not ended // ----- call Java-method to first refresh player text-data, sencond display this data. --------------- // init and start check of HTML-applet-instance must be activated (exactly one sometimes) // only one kind of text informations (for all data see javF01a()) function javF01e(X00,X01) // X00 pointer of HTML-Element only inside of document.body // X01 kind of information to get // 0 comment(non scrolled value) // text field must not exist // 1 name of file, text field must not exist // 2 duration, text field must not exist // 3 timepos, text field must not exist // 4 timeNow, text field must not exist // 5 dateNow, text field must not exist // 6 state of player, text field must not exist // 7 Progressbar-field value in percent "0" bis "100" // Progressbar must not exist // 8 Progressbar-field text-value // Progressbar must not exist (value in percent exist) // 9 Combobox of actual markes element // Combobox must exist (otherwise always empty string) // 10 Combobox get selected stat of element // "0" nothing is selected, "1" element is selected // Combobox must exist (otherwise always "0") // 11 Spinner value, Spinner must exist (otherwise always "0") // 12 state of play "0" silence, "1" musik active // 13 Applet-Java-instance not exist ? // returns a empty string in case of error // ----- init and start check of HTML-applet-instance (exactly one sometimes) ------------------------- // function javF01z(X00,X01,X02,X03,X04,X05,X06,X07) // X00 ID of HTML-applet-container, not null, not empty // The container must exist. // The container must have the property .innerHTML // The container is completely replaced concerning the contents. // X01 GUI-conffile name, not null, not empty // The file must exist and lie within the path of applet. // X02 Music-conffile name, not null, not empty // The file must exist and lie within the path of applet. // X03 width of java-symbol (visible if applet is loading) // string of digit values like "1" (pixels),not null, not empty // if X06 with value true then X03 set to "1" ( // if X06 true should be given so "1", so that no empty surface, so no empty space originates. // if largely enough so that mouseover is possible, a tool tip appears to the fastening of the player. // The Java icon needs at least 25-pixel width and height. // If width and height are smaller, a clearance is indicated. // X04 height of java-symbol (visible if applet is loading) // string of digit values like "1" (pixels),not null, not empty // it is evaluated only if X06 set to false. // if X06 true should be given so "1", so that no empty surface, so no empty space originates. // if largely enough so that mouseover is possible, a tool tip appears to the fastening of the player. // The Java icon needs at least 25-pixel width and height. // If width and height are smaller, a clearance is indicated. // X05 true so source of applet ist JAR-file // false so source of applet ist CLASS-file // names of jar- and class-file are fixed predefined. // X06 true so java-yymbol ist not visible during load, see X03 and X04 // The Java icon needs at least 25-pixel width and height. // If width and height are smaller, a clearance is indicated. // X07 true so GUI of player in german, else GUI in english // it is evaluated only if X05 set to true. // returns true if all okay an check was started 5. Javascript control of the applet without mp3playerApplet.js ================================================================= not possible