How to use an HTML file with Parameters to make an audioClip

HI guys,
I am still working on getting simple sound to work in my program! I have learned that I can use Java.Applet's soundClip object, even when not using an Applet, but I do not know how to work with the URL object. Here is a SCCE so you can see where I am at!
The Java Class:
public class PlaySound {
    public static void main(String[  ] args)
    throws java.net.MalformedURLException
    java.applet.AudioClip clip = java.applet.Applet.newAudioClip(new java.net.URL(null));
    clip.play( );
}The HTML file (Lets call it "file.html"):
<html>
<body>
<param name="test" value="test.wav" />
</body>
</html>Now obviously I should not be passing the URL null, what should I pass it and how? Also, is the HTML file written properly? Thanks!
-Christian S.
Edited by: Christ_Guard on Jun 10, 2008 9:41 AM

Christ_Guard wrote:
Thanks! Thats exactly what I needed! Should I be saving my sound files in the bin Directory?That was just the simplest solution. Resources can be anywhere, as long as you know where! This icon tutorial gives some examples.
[http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html#getresource]

Similar Messages

  • Gridworld Case Study - how to use a .jar file with textpad

    Hello,
    I am a student currently working on a project involving the Gridworld case study. While trying to work on my project at home, I discovered that I would get new "cannot find symbol" compiler errors that I had not previously gotten while compiling the same code at school. I am assuming this has something to do with the .jar file included in the gridworld code. How do I get textpad and/or the java compiler to find and use the .jar file and reccognise the classes which i am importing and extending in my project?
    Thanks,
    -Alex

    Thanks, It works for compiler now.
    Now, I write a html to run the applet. appletviewer
    says "
    java.lang.NoClassDefFoundError: ij/process/ImageProcessor
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
    at java.lang.Class.getConstructor0(Class.java:1762)
    at java.lang.Class.newInstance0(Class.java:276)
    at java.lang.Class.newInstance(Class.java:259)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:566)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:495)
    at sun.applet.AppletPanel.run(AppletPanel.java:292)
    at java.lang.Thread.run(Thread.java:536)
    It seems the appletviewer can not find the right path for the package. How can I fix this?
    Thank again,
    Hillxy

  • How to "use" a xml file with a script?

    Hey Guys!
    I use the normal Button with the send-option to send the xml file to an url.
    My question is how it's possible to work in a php-script with the xml data out of the formular?
    Thanks for help.
    LG
    Adrian

    Hi,
    I need to read a XML document with StringReade class.
    My aplication receives an absolute path but this
    doesn't work:
    StringReader oStringReader =
    new StringReader(c:\java\libros.xml);
    However it works with:
    StringReader oStringReader =
    new StringReader("<?xml version="1.0" e......");
    ie, with the whole document as a String, but I need
    to do it as the frist way.
    Thankstake a look at this link:
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/2a_echo.html

  • How to get real html files with forms 6i

    I know this may be a repeat question, but this is our context :
    We are deploying a heavy Forms6i app to the web. Everything is ok. We're able to run the forms in the MS Internet Explorer 5 native java window, without having to download first Jinitiator (8Mo) on the client.
    BUT it takes to much time to initiate the session, this is way to heavy.
    Do you know when Forms6i will be able to generate real html files on the fly or any way to have a quicker access to Forms through the web.
    Thank you very much

    Thanks.
    1/ Actually most of the customers will use our app through normal 56k modems. Their first connection must avoid to download Jinitiator which is 8Mo, so we don't want people to use Jinitiator (opening the session is even longer with Jinitiator than IE5).
    2/ Moreover, the applet window has a grey title line with the word "window" and the name form : this is not internet at all ;-)
    3/ A normal connection through a firewall doesn't work with the famous port 9000.
    help please.
    Thank you
    null

  • How to use the html:link with a arraylist

    Hi everyone:
    I want to display the data using struts html:link.
    I query the database and place all the data to javabean,later place all the javabean to ArrayList.In Action,I use the "request.setAttribute("lovetable",articlelist) to set request to jsp page.
    I want to pass a parameter "id" use the hyperlink so I can get the parameter when I click the hyperlink.
    But how to use html:link to display it?
    I use <html:link action="viewtopic.do" paramId="id" paramName="lovetable" paramProperty="id"/>,it can't work and Tomcat report error :
    org.apache.jasper.JasperException: No getter method for property id of bean lovetable
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    The lovetable is a ArrayList and it don't have a getter or setter method.
    How to use it pass parameter? :( Thks

    Thank you.
    I use the bean:define successful.And display all the data to jsp.My jsp code is:
    <logic:iterate id="love" name="lovetable">
    <bean:define id="idbean" name="love"/>
    <tr bgcolor="<%=color%>">
    <td><bean:write name="love" property="id"/></td>
    <td><html:link forward="viewtopic" paramId="id" paramName="idbean" paramProperty="id"><bean:write name="love" property="title"/></html:link></td>
    <td><bean:write name="love" property="name"/></td>
    <td><bean:write name="love" property="time"/></td>
    </tr>
    </logic:iterate>
    In Action : request.setAttribute("lovetable",articlelist)
    ResutlSet rs=.............
    List articlelist=new ArrayList();
    while(rs.next()){
    articlebean bean=new articlebean();
    bean.setName(rs.getString("name"));
    bean.setTitle(rs.getString("title"));
    articlelist.add(bean);
    The above code will work property.
    The Tag "html:link" need bean to work other than arraylist so I iterate all the bean out.
    The Tag "logic:iterate" need collection to work so I make Action return a List.
    right?
    Any idea? :)

  • How to generate an html file with tiles of my m3ps

    I am trying to build a small webpage that will point to about 1000 mp3s but I dont want to type the song title for all the 1000 mp3s.
    is there anyway of generating an html file instead?
    -thanks.

    Abraham--
    You should look at Doug's Apple Scripts. There are a couple of ready made AppleScripts there that might well do what you want. I see two or three that export HTML.
    HTH,
    charlie

  • How to use external .tld files with uix

    Hey,
    I have a set of custom .tld files and that i was to use in my UIX pages. I got them to work correctly if I am using jsp files but for some reason it doesn't recognize the tags when they are in uix pages
    I far as I can tell, UIX actually requires xml schema definition of the tags and the just the .tld file is not sufficient.
    My question is, is this the correct conclusion?
    if so is there a easy way to either convert my tld file or create this xml schema file so that my tags will be visible to uix.
    or am I totally off the mark here...

    there is one utility in j2se jar and check the option also
    put that jar file in lib folder of yr application folder
    [email protected]

  • How To  use fckeditor HTML with  flex

    I am using coldfusion server technlogy.
    I am trying make demo site Flex with coldfusion.
    I want to know how to use html code with my mxml application.
    Privious i am using FCK TEXT editor with my HTML File
    Currently flex have small text editor But i need full text
    editor with all feture which include FCK Editor
    Please let me know how to integrate Fck Editor with flex
    application . Or any html file with Flex Application

    Flex has a very limited support for HTML, thus you cannot
    create a full featured editor within flex. The only work arounds I
    have seen are done using IFRAME's over your app.
    Not sure if it an option, however Apollo does a good job of
    addressing this issue by allowing full feature Javascript and HTML.
    Allen

  • Hi i have a learning HTML file with a data file include a swf files how can i open it in my ipad?

    hi i have a learning HTML file with a data file include a swf files how can i open it in my ipad?

    iPad do not support flash natively.
    Look in the app store, some browsers do support flash with limited functionality.

  • How to save HTML file with images present in the server to local machine

    Hi all
    In my application i have a option for the user to save HTML files with images present in the server. The HTML file is getting saved but the images are not being saved.
    The code i am using is below :-
    l
                        File fname = new File(filePath);
                        if(!fname.exists())                return;
                        FileInputStream istr = null;
                        OutputStream ostr = null;
                        response.setContentType("application/"+format);
                        response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");
                        try { 
                             istr = new FileInputStream(fname);
                             ostr = response.getOutputStream();
                             int curByte=-1;
                             while( (curByte=istr.read()) !=-1)
                                  ostr.write(curByte);
                             ostr.flush();
    Can anyone suggest what i need to do
    regards

    The client should probably parse the html that comes down, and look for <img> links, and request those of the server as well.

  • How  we can use forms HTML capabilities with Oracle Applications?

    Hi
    Could not find any specific doc how we can use forms HTML capabilities with Oracle Applications?
    Thanks

    I'm not sure that I understand exactly what you are asking?
    What are you trying to do? If you could give a detailed explanation then we can try and assist.
    Reagrds,
    Bren

  • How to display local HTML file in web-view?

    Hello everyone,
    we have no problem with showing of remote HTML content from server in box on page in web view. But how we can show such a content when included in HTMLResources? In guide is just "Display a local HTML file in an in-app browser", which works wihout problem, but we don't want to show this HTML content in in-app viewer, it should be part of page.
    Thanks
    Martin

    Now i'm confused. In guide is this:
    To use local HTML files, click the folder icon and specify the local HTML file. The HTML file (such as index.html) should appear in a folder that includes any images or scripts used in the HTML file.
    But no info where such a local HTML file should reside. If this file is in HTMLResources, it is ignored.

  • How to load unicode data files with fixed records lengths?

    Hi!
    To load unicode data files with fixed records lengths (in terms of charachters and not of bytes!) using SQL*Loader manually, I found two ways:
    Alternative 1: one record per row
    SQL*Loader control file example (without POSITION, since POSITION always refers to bytes!)<br>
    LOAD DATA
    CHARACTERSET UTF8
    LENGTH SEMANTICS CHAR
    INFILE unicode.dat
    INTO TABLE STG_UNICODE
    TRUNCATE
    A CHAR(2) ,
    B CHAR(6) ,
    C CHAR(2) ,
    D CHAR(1) ,
    E CHAR(4)
    ) Datafile:
    001111112234444
    01NormalDExZWEI
    02ÄÜÖßêÊûÛxöööö
    03ÄÜÖßêÊûÛxöööö
    04üüüüüüÖÄxµôÔµ Alternative2: variable length records
    LOAD DATA
    CHARACTERSET UTF8
    LENGTH SEMANTICS CHAR
    INFILE unicode_var.dat "VAR 4"
    INTO TABLE STG_UNICODE
    TRUNCATE
    A CHAR(2) ,
    B CHAR(6) ,
    C CHAR(2) ,
    D CHAR(1) ,
    E CHAR(4)
    ) Datafile:
    001501NormalDExZWEI002702ÄÜÖßêÊûÛxöööö002604üuüüüüÖÄxµôÔµ Problems
    Implementing these two alternatives in OWB, I encounter the following problems:
    * How to specify LENGTH SEMANTICS CHAR?
    * How to suppress the POSITION definition?
    * How to define a flat file with variable length and how to specify the number of bytes containing the length definition?
    Or is there another way that can be implemented using OWB?
    Any help is appreciated!
    Thanks,
    Carsten.

    Hi Carsten
    If you need to support the LENGTH SEMANTICS CHAR clause in an external table then one option is to use the unbound external table and capture the access parameters manually. To create an unbound external table you can skip the selection of a base file in the external table wizard. Then when the external table is edited you will get an Access Parameters tab where you can define the parameters. In 11gR2 the File to Oracle external table can also add this clause via an option.
    Cheers
    David

  • How to configure the .ini file with applet

    hai
    i am using native methods in that methods they use some ip addresses. when i am using that native methods in applet run the applet using appletviewer tool it works fine but when i am open that applet using html page browser not configure that .ini file data .how to configure that .ini file with browser

    Hi Jay SenSharma,
    Thanks for your immediate response.
    I saw your URL links, But in your link give the recursive deployment using wlst. But my question is how to configure the oracle weblogic library files into Admin server & Managed Servers by using the wls.jar file through wlst script to create the new domain.
    But if create the new domain by using GUI mode then we manually give the admin server port number & managed servers port number and name.
    By default the library files are configured with the Admin server in GUI mode. But the Managed server the Library files are not configured with the Managed servers. Then we manually select all the library files to the corresponding managed servers. Then only the applications are deployed into the corresponding managed server.
    Regards,
    S.vinoth Babu

  • How to load local html-file into webBrowser tool? [SDK 6.5]

    The webbroser tool lets you load an external html by inputting the adress in its "Url"-property.
    But how do you load a local html-file that is added to your project? Lets say the path is: Folder1/Subfolder1/Webpage1.html. What would I put in the Url-property to make this work?
    While on this subject, what is the support for css and javascript when using locally loaded webpages in the webbrowser?

    Thanks for the answer Malleswar, but I have now played around with all variations of that code-line that I can think of, but still I can not locate the html-file that is located within the project. Since Im planning to distribute the html-files with the executable (as one file) it should read it directly from wherever the application is installed.
    The html-file is included within the project. Solution Explorer -> Solution 'myProject' -> myProject -> Webpage1.html
    Which is (as usual) also where the Form1.cs (which contains the webBrowser-component) is located.
    Any ideas of how the Uri should be constructed in this case?
    Thanks,
    Daniel

Maybe you are looking for