How to put sound in Application

Hi guys,
I am tryin to put sound in Java application but I can't figure out how to do that. It is totaly different than on JApplet.
Can you guys tell the steps to put sound?
Thank you

Hi,
He doesn not work i tried all the way but no compiling errors but it gives error when the sound need to be played.
Here is my code
private AudioClip clipEat;
File fileEat = new File("SnakeGameApplication\\potato_c.wav");
try {
               AudioClip clipEat = Applet.newAudioClip(fileEat.toURL());
          } catch (IOException err) {
clipEat.play();Cheers

Similar Messages

  • How to put sound in an application (not an applet)

    i was wondering how to put sound in a application.
    what code do i need and where should i put it

    Please do not create duplicate threads. Abandon this one and continue to post in your original here:
    http://forum.java.sun.com/thread.jspa?threadID=5203167&messageID=9810376#9810376

  • How to put sound player with selection to a flash site?

    hi to all flash fanatic,
    I want to put a sound player with selection in my flash site
    design. Anybody can teach me how or give me a sample code or file
    like I'm talking about. pls.
    Tutorial link also big help if u knw any link tutorials that
    deals to my problem.
    here are some web site sample of what I'm referring:
    1.
    http://ccmbscoe.ifastnet.com/
    2.
    http://liquid-body.com/main.html
    3.
    http://officialkimkardashian.com/
    Pls help me, I need it badly to my project.
    many tnx an advnce
    norman-RP

    hi hugh,
    ty for ur tym for answring and I appreciate it alot, can u
    tell me how can i get d video dt u r talking about?
    can u give me d link? is it free?
    hope u give me another tym of your bc sked.
    many tnx
    norman

  • How to put sound to a JButton.

    How can I add sound to a JButton if it isn't an applet.
    It is an application.

    hi hugh,
    ty for ur tym for answring and I appreciate it alot, can u
    tell me how can i get d video dt u r talking about?
    can u give me d link? is it free?
    hope u give me another tym of your bc sked.
    many tnx
    norman

  • How to put password in applications

    My kids play with my iphone and I wanted to put password on messages, mail, notepad, etc.. How do I do that?

    To be more correct, it is not possible on the data you mentioned but there is a chance with some file and Apps, like Excel files PDF files and probably Word  (you can protect them and open the office files with Pages and Numbers which will ask the password.  You can load some files with Goodreader and they will go in a memory place where to be found by Goodreader. Goodreader can be protected with a password and then also the data file (as a PDF) can have its own password.
    As you see there are possibilities but I do not know any for Mail, Messages and Notepad.
    Last big problem.  If a kid uses you iPhone this will happen after opening its "Start" password and the risk is to completely reset the iPhone, therefore even the protected files will be lost.

  • How can I put my main Application class in a package?

    Hello,
    I would like to put my main Application class for my air app inside a package. If I create a regular FLX application, this works fine. In that case I just move the application file created into a packade and change the run/debug settings. This does not work for an Air app however, when I try I first get the error:
    Adobe AIR application is missing the corresponding MyApp-app.xml
    So I move the MyApp-app.xml into the same package, then I get:
    Unknown error generating output application.xml files. Check the Eclipse error log for more details.
    Is it possible to have the man Application class reside inside a package for air applications?
    Regards,
    Mikael

    Hi Mikael,
    I ran into the same result as you so I asked around and it sounds like this might not be supported.  However, I'd recommend reposting this question over on the Flash Builder forums to see if anyone has found a workaround.
    Please let me know if you're able to resolve this.
    Thanks,
    Chris

  • How to put name in the application toolbar

    how to put name on the button in the application tool bar while it is created with selection screen

    I've never seen this done this way.  Learn something new everyday.  Anyway, here is a sample program that will show you what you need to do to add text to your function button,  this also adds an icon.
    report zrich_0002.
    Tables: sscrfields.
    selection-screen function key 1.
    select-options: s_datum for sy-datum.
    INITIALIZATION.
      MOVE '@49@ Export'  TO SSCRFIELDS-FUNCTXT_01. "ICON_EXPORT
    If this has solved your problem, please award points accordingly and mark this post as solved.  Thanks.
    Regards,
    Rich Heilman

  • How to put together a two camera shoot and sync sound

    I have some live footage of musical performance. I have footage from two cameras and the sound off the desk that I need to sync up. Can somebody suggest the best way to do this? I had hoped I could sync the sound to both cameras, then put in which shots I chose at any given point, but I don't know if the system will do that. Any suggestions?

    You want to do a multicam.
    It is extremely well suited for this.
    Since you don't seem to be aware of this, I recommend that you follow some good tutorials on this.
    To get you started, take a look at a few videos explaining how this works; then you may want to read a bit on the manual of the software.
    You may want to start with episode of 153, which explains how to put together a multicam clip: https://www.youtube.com/watch?v=qKhmZbVgywk
    Then follow the next episode, about cutting.

  • How would I make it so that when "deleting" an image I can make it so that the delete key does it or a button I put on the application?

    How would I make it so that when "deleting" an image I can make it so that the delete key does it or a button I put on the application?
    I want it so that I can use either a button on the designer window or the delete key. I know how to do the or part but the trouble I'm having is coding the button in.
    if (LastImageClicked != null && (e.Key == Key.Delete || Button))
    This is the code that I have in the format I'm looking for I just don't know how to do it. Thanks for your help!

    There are a number of things which are unclear about your question.
    I'll tell you one way to approach this though.
    Handle Window.PreviewKeyDown.
    <Window
    Window.PreviewKeyDown="Mainwindow_PreviewKeyDown"
    Code behind
    private void Mainwindow_PreviewKeyDown(object sender, KeyEventArgs e)
    if (e.Key == Key.Delete)
    File.Delete("p001.jpg");
    I don't know enough about what you mean by LastImageClicked  but you need some way of knowing which path you are going to delete.
    Then you might well have a problem if it's showing in an image control.
    You will need to copy the picture off disk into a new bitmapimage object.
    If you just do
    <Image Source="p001.jpg"
    Then that image will grab the file and you won't be able to delete it - you'll  get an error.
    In my experimental code p001.jpg is set as content copy always so it ends up next to the exe in the bin when the solution compiles.
    You would probably want a full path to a file there.
    Hope that helps.
    Recent Technet articles:
    Property List Editing;  
    Dynamic XAML

  • How do I add my Applications fold back onto the dock? People say I must drag it near the trash can, but that just puts it past that barrier. I am trying to get it back to where it disappeared from, on the left hand side near the finder icon.

    How do I add my Applications fold back onto the dock? People say I must drag it near the trash can, but that just puts it past that barrier. I am trying to get it back to where it disappeared from, on the left hand side near the finder icon. And how / why did it disappear?

    With respect, you actually cannot store folders on the left side of the Dock - only on the right side. I wonder if you're talking about Launchpad, which looks like a silver rocket and shows you your installed applications? It's not actually a shortcut to the Applications folder, though. You can certainly drag Launchpad into the left side of the Dock from the Applications folder.
    Matt

  • How to put applications folder in dock

    how to put applications folder in dock with lion.

    I had to put it in the bottom section of the dock, just above the trash can. It wouldn't go into the top part of the dock where all my apps are.

  • How to put a footer text in every page of the application

    How to put footer text in every page of the application without putting it page by page.
    Thanks.
    Jen

    Patick,
    Thanks for your reply.
    I still don't know how to do it.
    1. Have a look at the documentation for Page 0.
    There is no Page 0 in my application
    2. You can add your custom stuff to your page templates.
    Could you give me more detail on this?
    Thanks,
    Jen

  • How to put "Issue Tracking" Demo HTML DB application in my development site

    I have set up Oracle 10g DB and HTML DB 1.5 on my Windows/XP machine.
    I also downloaded issue_tracker-3rd demo to my machine.
    I am new to HTML DB.
    Can someone tell me how to put issue_tracker into my HTML DB environment and test running it?
    Many Thanks....

    cckung,
    If you unzip the issue tracker zip file you will find it has a readme.txt file in it.
    You should just follow the directions in this file and you'll have the demo working in no time.
    Greg

  • How to put Java application in the MS. Windows System tray

    dear all,
    Is it possible to make a Java application communicate with the MS. Explorer and to put a Java application in the MS. Windows System tray
    Regards

    http://www.esus.com/docs/GetQuestionPage.jsp?uid=624
    or look for madcap on sourceforge

  • How to download file from application server

    Hi Experts,
                  I developed report and execute in background mode. for this i used Open dataset transfer and close dataset . i got the requried output . But in this case user want downloaded file on presentation server so can anyone tell me How to download file from application server?
    i know it is possible through Tcode CG3Y. but i want code in program.

    This code will download a file to your Client package by package, so it will also work for huge files.
    *& Report  ZBI_DOWNLOAD_APPSERVER_FILE
    REPORT  zbi_download_appserver_file.
    PARAMETERS: lv_as_fn TYPE sapb-sappfad
    DEFAULT '/usr/sap/WBP/DVEBMGS00/work/ZBSPL_R01.CSV'.
    PARAMETERS: lv_cl_fn TYPE string
    DEFAULT 'C:\Users\atsvioli\Desktop\Budget Backups\ZBSPL_R01.CSV'.
    START-OF-SELECTION.
      CONSTANTS blocksize TYPE i VALUE 524287.
      CONSTANTS packagesize TYPE i VALUE 8.
      TYPES ty_datablock(blocksize) TYPE x.
      DATA lv_fil TYPE epsf-epsfilnam.
      DATA lv_dir TYPE epsf-epsdirnam.
      DATA ls_data TYPE ty_datablock.
      DATA lt_data TYPE STANDARD TABLE OF ty_datablock.
      DATA lv_block_len TYPE i.
      DATA lv_package_len TYPE i.
      DATA lv_subrc TYPE sy-subrc.
      DATA lv_msgv1 LIKE sy-msgv1.
      DATA lv_processed_so_far TYPE p.
      DATA lv_append TYPE c.
      DATA lv_status TYPE string.
      DATA lv_filesize TYPE p.
      DATA lv_percent TYPE i.
      "Determine size
      SPLIT lv_as_fn AT '/' INTO lv_dir lv_fil.
      CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
        EXPORTING
          file_name      = lv_fil
          dir_name       = lv_dir
        IMPORTING
          file_size_long = lv_filesize.
      "Open the file on application server
      OPEN DATASET lv_as_fn FOR INPUT IN BINARY MODE MESSAGE lv_msgv1.
      IF sy-subrc <> 0.
        MESSAGE e048(cms) WITH lv_as_fn lv_msgv1 RAISING file_read_error.
        EXIT.
      ENDIF.
      lv_processed_so_far = 0.
      DO.
        REFRESH lt_data.
        lv_package_len = 0.
        DO packagesize TIMES.
          CLEAR ls_data.
          CLEAR lv_block_len.
          READ DATASET lv_as_fn INTO ls_data MAXIMUM LENGTH blocksize LENGTH lv_block_len.
          lv_subrc = sy-subrc.
          IF lv_block_len > 0.
            lv_package_len = lv_package_len + lv_block_len.
            APPEND ls_data TO lt_data.
          ENDIF.
          "End of file
          IF lv_subrc <> 0.
            EXIT.
          ENDIF.
        ENDDO.
        IF lv_package_len > 0.
          "Put file to client
          IF lv_processed_so_far = 0.
            lv_append = ' '.
          ELSE.
            lv_append = 'X'.
          ENDIF.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              bin_filesize         = lv_package_len
              filename             = lv_cl_fn
              filetype             = 'BIN'
              append               = lv_append
              show_transfer_status = abap_false
            TABLES
              data_tab             = lt_data.
          lv_processed_so_far = lv_processed_so_far + lv_package_len.
          "Status display
          lv_percent = lv_processed_so_far * 100 / lv_filesize.
          lv_status = |{ lv_percent }% - { lv_processed_so_far } bytes downloaded of { lv_filesize }|.
          CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
            EXPORTING          "percentage = lv_percent - will make it fash
              text = lv_status.
        ENDIF.
        "End of file
        IF lv_subrc <> 0.
          EXIT.
        ENDIF.
      ENDDO.
      "Close the file on application server
      CLOSE DATASET lv_as_fn.

Maybe you are looking for

  • Image content not defined in TileList

    I have two images on a canvas, one is directly on the canvas using inline code, the other is embedded in a tilelist. Both images render. When I click and drag the inline image, the drag proxy appears normally. When I click and drag the image in the t

  • Error while deploying application with WebLogic server

    Hi, I use Jdeveloper 11g and created and ADF application which i want to deploy with WebLogic Server.But i have an error which is : "There was a failure when processing annotations for application C:\...\xxx.war. Please make sure that the annotations

  • Web Sharing Not Starting Up After installing PHP

    On Mac OS 10.4.9 on a G4 PPowerbook, using O'Reilly's "Learning PHP and MySQL," my Personal Web Sharing will not start up. I enabled Apache per their instructions and things seemed fine.. Then I i installed PHP with these commands, sudo vi/etc/httpd/

  • Sales order item repricing

    Hi, For a sales order, I need to check pricing date of each item. If order creation date(VBAK-AUDAT) <= Date in condition table <= Item pricing date( VBKD-PRSDT) , then I need to reprice that item with pricing type 'C'. Please let me know if there is

  • Fatal error on Installating Weblogic Server to install OEM

    I am following the instruction to install Oracle Grid Control 11gR1 from -> http://www.oracle-base.com/articles/11g/GridControl11gR1InstallationOnOEL5.php#java_installation Step ->Middleware Installation Grid Control 11g Release 1 no longer bundles t