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

Similar Messages

  • 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

  • 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 Load Sound In Java Application?

    Hi, i dunno what the codes to load sound in java application, can anyone help me and provide me with the codes? Thanks a lot.

    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2Btitle%3Aapplication+%2Btitle%3Asound&col=javaforums
    BTW: You can doo this yourself

  • 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 footer in the Delivery note  sap script form.

    Hi All,
      i am new to SAP SCRIPT , can any one guide us how to Create a footer in the Delivery note sap  script.
      I need to put  some message if the stock of the material is "0"(zero).
           can anyone  tell me the process to do this.
    Thanks
    Channappa Sajjanar

    Hi,
    U create a window in script (Footer), and in the Driver program call this window at last..
    eg:
    create a window in script and call it at the end in the layout..
    /E FOOTER
    P1 'Write Required text what u want to display;.
    now in print program, after printing all the line items in ur internal table call the FM write_form to print the footer...
    LOOP AT itab.
      call function 'WRITE_FORM'
        exporting
         window = 'MAIN'
        exceptions
          others = 1.
    endloop.
    now call, FM write_form to print the footer
    IF stock EQ 0.
    call function 'WRITE_FORM'
        exporting
         window = 'FOOTER'
          element = 'FOOTER'
        exceptions
           others = 1.
    endif.
    Hope it helps!!
    Rgds,
    Pavan

  • 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 add sound to an application

    how would i add sounds such as 'well done' to an application that is designed for children.
    please could someone guide me as i dont have a clue of how to do this.

    I do it like this:
    sound = new Applet().newAudioClip(getClass().getResource("sound.mid"));of course that's limited to only .mid, .wav, and .au

  • How to Play Sound on the Hour - not Voice

    I miss the ability I had in Classic to play a sound on the hour and half hour. In OSX, it seems that only having a voice announce the time is an option - unless I'm missing something.
    Does anyone know of a workaround? I hate the voice thing and would rather listen to a pleasant sound.
    Thanks in advance for any help offered.

    Install the recently released OS X version of Sounds4Fun (www.macupdate.com or www.versiontracker.com.) Once the premier OS 9 utility for assigning sounds to system actions including assigning sounds to the time (1/4, 1/2, 3/4, top.)
    Also can assign sounds to dozens of other actions.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • Know how to put pics in, but itunes not showing all options HELP!

    k,well I followed all the instructions to get pics in, I connected my ipod with my computer and I opened iTunes. But when the directions state, "When the iPod icon appears in iTunes, select it and click the Photos tab" I can't find the Photos tab! Instead of showing me tabs, it displays an agreement document. I read it, check the box showing that I agree and understand the terms and click save. NOTHING HAPPENS! also, for some reason, part of the page is cut off and I can scroll sideways to see it. Thanks for reading this, hope you can help!

    Set the screen resolution to at least 1024x768.

  • How to put a little textbox in a regular applet window for user input

    Hi i was just wondering if anybody knows how to draw a text box, (for user input), in a applet window and be able to put it in a specific spot, like when you draw a rectangle.
    I have searched the web and have not found any answers, but i have seen projects that do this but they dont have the source code.

    JTextField?

  • Displaying an image in a application, not an applet

    I know that this is a simple process, but I can not figure out how to display a simple image like a jpeg or something. Could someone help me out here.

    how do I give the path for the imageFor questions like this you'll more quickly find the answer from the API documentation: http://java.sun.com/j2se/1.4/docs/api/
    The particular class in question now is java.awt.Toolkit:
    http://java.sun.com/j2se/1.4/docs/api/java/awt/Toolkit.html

  • How to get a image in Application?

    as title
    Image img = new Image();
    I want to used the " g.drawImage(img,0,0,this);but how can i get img in Application ,not in Applet.
    best regards

    Belowing is the Answer .
    import java.awt.Toolkit;
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    Image cloud = toolkit.getImage ( "images/CLOUD.jpg" );
    g.drawImage(cloud,20,20,this);

  • How to add images into a java application (not applet)

    Hello,
    I am new in java programming. I would like to know how to add images into a java application (not an applet). If i could get an standard example about how to add a image to a java application, I would apreciated it. Any help will be greatly apreciated.
    Thank you,
    Oscar

    Your' better off looking in the java 2d forum.
    package images;
    import java.awt.*;
    import java.awt.image.*;
    import java.io.FileInputStream;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    /** * LogoImage is a class that is used to load images into the program */
    public class LogoImage extends JPanel {
         private BufferedImage image;
         private int factor = 1; /** Creates a new instance of ImagePanel */
         public LogoImage() {
              this(new Dimension(600, 50));
         public LogoImage(Dimension sz) {
              //setBackground(Color.green);      
              setPreferredSize(sz);
         public void setImage(BufferedImage im) {
              image = im;
              if (im != null) {
                   setPreferredSize(
                        new Dimension(image.getWidth(), image.getHeight()));
              } else {
                   setPreferredSize(new Dimension(200, 200));
         public void setImageSizeFactor(int factor) {
              this.factor = factor;
         public void paintComponent(Graphics g) {
              super.paintComponent(g);
              //paint background 
              Graphics2D g2D = (Graphics2D) g;
              //Draw image at its natural size first. 
              if (image != null) {
                   g2D.drawImage(image, null, 0, 0);
         public static LogoImage createImage(String filename) { /* Stream the logo gif file into an image object */
              LogoImage logoImage = new LogoImage();
              BufferedImage image;
              try {
                   FileInputStream fileInput =
                        new FileInputStream("images/" + filename);
                   image = ImageIO.read(fileInput);
                   logoImage =
                        new LogoImage(
                             new Dimension(image.getWidth(), image.getHeight()));
                   fileInput.close();
                   logoImage.setImage(image);
              } catch (Exception e) {
                   System.err.println(e);
              return logoImage;
         public static void main(String[] args) {
              JFrame jf = new JFrame("testImage");
              Container cp = jf.getContentPane();
              cp.add(LogoImage.createImage("logo.gif"), BorderLayout.CENTER);
              jf.setVisible(true);
              jf.pack();
    }Now you can use this class anywhere in your pgram to add a JPanel

  • How to put adsense in iphone app?

    hi
    Please tell me about How to put adsense in iphone application
    please send me sample code

    From Pages help:
    Adding Accent Marks
    You can use the Keyboard Viewer to add accent marks to characters. The Keyboard Viewer shows the characters for the keyboard layout or input method selected in the Input menu. For example, if U.S. is chosen in the Input menu, you see the characters that appear on a U.S. keyboard in the Keyboard Viewer.
    To add accent marks: 
    Choose Show Keyboard Viewer from the Input menu on the right side of the menu bar.The Input menu appears on the right side of your menu bar and looks like a flag or character. If you don't see the Input menu, go to Viewing Keyboard Layouts for Other Languages for instructions on viewing the Input menu.
    Press Shift, Option, or Option-Shift to highlight the available accent marks in the Keyboard Viewer.The accent mark keys are highlighted. Depending on your keyboard, you may not need to press any of the modifier keys to see the accent keys.
    Place the insertion point in your document where you want to type.
    Press the modifier key you pressed in step 2 (Shift, Option, Option-Shift, or none) and then press the key on your keyboard that is in the same place as the accent you see in the Keyboard Viewer.
    Release the modifier key, and then press the key for the character you want to accent.For example, on a U.S. keyboard, to make é appear, press Option and E (the accent key), and then press E (the letter on which you want that accent to appear).

Maybe you are looking for

  • After upgrading to Mountain Lion, Interface builder starts up with an error every boot.

    I've got a late 2008 Macbook Unibody 13", and a few months back I upgraded from Snow Leopard to Mountain Lion.  Ever since the upgrade, at every boot up Interface Builder starts up with an error.  I've just ignored it mostly, but now I'm getting anno

  • Windows 8.1 Lenovo Yoga 2 Pro "Network Driver not properly installed"

    I've just received a brand new Lenovo Yoga 2 Pro just a few hours ago, and already there seems to be a problem. Windows 8.1 keeps telling me it cannot find any networks, and when I troubleshoot problems, it tells me that my drivers are not properly i

  • Source systems vanishes from RSA1 after renaming of the LSN after BDLS

    Dear BW/BI Experts,            We are doing BW3.1 upgarde to BI7.0........After system copy there is need of rename of logical system for BP1 to BD1 (Prod. to Dev. and Dev. is our new Target BW system ) and From RP1 to RQ1. Before renaming I checked

  • Lightroom4 prints are too light

    I have documented the lighter print output from LR 4 a while back and have been waiting for someone at Adobe to notice and offer some solution to this problem. I use a robust printing workflow and have done the experiments under very carefully contro

  • JdoPostLoad() does not get executed!!!

    Kodo 2.4.3 Sequence 1. Create PC (docket) 2. Persist it 3. evict it 4. read one of its fields of PC type - jdoPostLoad() isn't triggered OR read one of its simple fields which are part of default fetch group - jdoPostLoad() gets triggered After evict