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

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 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 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 an icon to Jbutton with Jbuilder 5?

    I have tried to make a jbutton with icon on it,
    i create an image icon object and pass it to the jbutton.seticon method...
    When create the image icon, it need the path of the icon file, what is the relative path of image in jbuilder?
    (not absolute e.g file:///)
    Thanks

    What you need to do is
    if your current class is Test and you image file is in the same directory called cat.gif then do the following
    button.setIcon(new ImageIcon(Test.class.getResource("cat.gif")));
    this should work
    if you image file is in the previous directory you just type in "../cat.gif" and if you have a image directory reltaive then you put in "images/cat.gif"
    I hope this helps

  • 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 to put a single stack item to an album?

    Maybe a silly question, but I can't find out how to put a single item from a stack into an album. When I drag a stacked item to an album, the entire stack appears in the album. This is not what I want, I want to get the single item in the album.
    I know I can make a single stacked item in an album to be the albumpick. But this is not enough. Sometimes I need to put two items from the same stack into this album.
    Koen
    Message was edited by: Koen van Dijken

    Koen van Dijken wrote:
    Would this be as designed, and so a wrong use of stacks by me?
    It is as designed but I don't think what you want to do is a particularly wrong use of stacks. I can see using stacks as a way to reduce clutter in the browser but still wanting to be able to get to individual images in the stack to use..
    What is interesting is the wording in the Aperture users guide concerning stacks:
    Dragging Stacks
    You can drag an entire stack to a new location, *and you can drag specific images within a stack to a new location*. When a stack is closed, dragging the stack moves the entire stack. *When a stack is open, you can drag individual images to new locations in the Browser*. You can also drag images into a stack. If you drag an image within a stack into a different project, however, the entire stack moves to the new location.
    (emphasis added)
    So the first part sounds like you should be able to drag an image out of the stack to an album, the second just mentions dragging an image out of the stack in the browser.
    And in way you can do this, the only thing is what you end up doing is unstacking the image you drag out. Not exactly what you would want to do.
    I think it should be OK to place individual stack items into albums and have them remain in the stack. Any reason this would be a bad idea?

  • How to put the current timer in the frame

    I am doing one application and i am using frame. I want to show the current time( hour and minute). But i don't know how to implement it. Please help me to solve my problem. Below is the sample code of my program. How to put the timer in the bottom part.
    //AdminMenu.java
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class AdminMenu extends JFrame{
    private JLabel lblmenu;
    private JLabel lblvideo;
    private JLabel lbladmin;
    private JButton cmdaddvideo, cmddeletevideo, cmdeditvideo;
    private JButton cmdaddadmin, cmddeleteadmin, cmdchangepass;
    private Container c;
    private GridBagLayout gdlayout;
    private GridBagConstraints gdconstraints;
    private Color colorValues[] =
    { Color.black, Color.blue, Color.red, Color.green };
    public AdminMenu()
    super("Administration Menu");
    JMenu fileMenu = new JMenu( "File" );
    fileMenu.setMnemonic( 'F' );
    JMenu openMenu = new JMenu ("Open");
    openMenu.setMnemonic('O');
    fileMenu.add( openMenu );
    JMenuItem exitItem = new JMenuItem( "Exit" );
    exitItem.setMnemonic( 'x' );
    exitItem.addActionListener(
    new ActionListener() {
    public void actionPerformed( ActionEvent event )
    System.exit( 0 );
    } // end anonymous inner class
    ); // end call to addActionListener
    fileMenu.add( exitItem );
    // create menu bar and attach it to MenuTest window
    JMenuBar bar = new JMenuBar();
    setJMenuBar( bar );
    bar.add( fileMenu );
    setSize(300,250);
    setLocation(350,200);
    this.setResizable(true);
    show();
    //---------------------- Main -------------------------------
    public static void main(String args[])
    AdminMenu app = new AdminMenu();
    app.setDefaultCloseOperation(
         JFrame.EXIT_ON_CLOSE );
    Thanks for helping me

    e.g. use a thread that invokes new Date() (every minute), format the Date with SimpleDateFormat and print the result String on a Label that you can put on your frame ...

  • Putting sound in both channels

    I shot a video using a mic that only recorded in the left channel. How do I put sound in the right channel, as well? I this something I select when exporting the movie? If so, do I select "mono" or "stereo"?
    thanks.

    Hi
    I did as follows.
    • Select all video clips
    • Advance menu -> down to Extract Audio
    • Share to QuickTime -> Expert mode and audio only as .aiff
    • Use a sound editor to mix-down to mono: I got Audacity - (free) to
    do this.
    • Save as audio .aiff
    • Import this into iMovie and mute the other audio tracks.
    Done
    This can also be done - with GarageBand - But I've not done it that way.
    Yours Bengt W

  • How to put ring tone in folder?

    Can not figure out how to put ringtones in the ringtone folder in itunes on my Mac before syinc to iphone. Tried to drag, tried to copy no luck can some one help? (Itunes 9.0.2)

    If they are not under the ringtones tab, they are not ringtones.
    It is a two step process. 1) Get the song/file/sound 2) Create the ringtone

  • [Q]: How to put MatLab 5.2 code (*.m) in LabVIEW 5 ?

    Hi,
    Is there somebody who know if it is possible (and how)
    to put MatLab 5.2 code (*.m) in LabVIEW 5.0 ?
    I use LabVIEW for my Audio sound and graphical Interface
    and I use MatLab for sound mathematic calculation....
    Thanks in advance.
    Best regards.

    Try to read this.
    http://digital.ni.com/public.nsf/3efedde4322fef198​62567740067f3cc/2f8ed0
    f588e06be1862565a90066e9ba?OpenDocument
    Paul
    In article <[email protected]>,
    [email protected] wrote:
    >
    > Hi,
    >
    > Is there somebody who know if it is possible (and how)
    > to put MatLab 5.2 code (*.m) in LabVIEW 5.0 ?
    > I use LabVIEW for my Audio sound and graphical Interface
    > and I use MatLab for sound mathematic calculation....
    >
    > Thanks in advance.
    > Best regards.
    >
    >
    Sent via Deja.com http://www.deja.com/
    Before you buy.

  • How to attach sound to any button?which will continue that sound.

    Hi,
    Am working on Flash cs5.Can anyone tell me how to attach sound to any button?which will play after click on button.this sound should play continue till 2-3 scenes ahead.Am working on project which has 3 button with diffrent sound.and the sound button contains some scene which has volume seter.I mean,if user want to hear that sound in slow,medium or high pitch.the code should set as per this.Its in as 2.
    This site is like "karaoke".just the sound is classical music.It will continue on software and user will sing a song.
    Can anyone help me?At working on this from last 2 months.and its hard for me to get perfect answer.

    Add your sound clip to the library and give it a Linkage ID of "mySoundClip"
    Assume your button is in frame 1.
    GIve your button the instance name of "mySoundBtn". And put this code on frame 1 (timeline).
    stop();
    mySoundBtn.onRelease = function () {
              mySoundC = new Sound(this);
              mySoundC.attachSound("mySoundClip");
              mySoundC.start(0, 10);  //10 represents the number of loops
              gotoAndPlay(2);
    than put this code on the timeline frame where you need the sounsd to stop.
    stopAllSounds();
    Also If you want to be able to play the sound from your local disk without attaching it to the swf, use .loadSound("the url", true);

  • How to put mp3 along in flash file and control stop start

    Can someone tell me how to put mp3 which is just speaches done, be put alone in a flash file. Do i have to import sound? I wanted to be able to put 3 different mp3 files in flash and have people able to click on any sound and hear it. Be able to play and start and pause a sound. Is it possible are should I use something other than flash. Are should I convert to mp3 into another format and put in flash.
    Thanks for you help,

    Yes, you need to import sound. It's just File>Import>Open External Library (in CS4, the third step may be different for others), and then browse to the files you want. They'll be put into the library.
    To do what you're asking, I would put the sounds into each of their own movie clips, and have buttons inside the movie clips to control the timeline. For instance, the pause button would just have the onRelease = function(){ stop(); }; code applied to it.
    Does this help?
    EDIT: Also, mp3 is good for Flash.

  • How to input sound in FCEX

    Hi
    How do I in put sound to over right a video, as I have what looks like an Optical digital audio input is S/PDIF format and uses a standard Toslink cable with a Toslink mini-plug adapter, accepting up to 24-bit stereo and 44.1-96kHz sampling rate, what knid of mic do I need?
    Ta

    The 'Pro' in title of the device is, in all realities, just marketing - so making an off topic statement about what 'professionals' do is not helping him... but based on your other comments, your goal was to belittle and mock the original poster.   I would bet that most owners are 'professionals' in the sense that 'they have jobs' and are not using the MacBook Pro as the primary device to generate an income... to most it is merely a very nice computer to do work on.
    If you had more experience with your MacBook Pro (I assume you own at least one) or if you have ever used VMware Fusion or BootCamp for Windows or Linux distros you would have noticed that the speaker in the MacBook Pro can very easily go much louder.
    And as for your very small comment about stereo - I for one enjoy watching some streaming training videos or simple documentaries on occasion and more often than not I must resort to abandoning OS X to simply hear anything over the general noises around the office or house - it is obviously an artificial restriction (read 'software not hardware') and the original poster has a very valid point and a very innocent question.

  • HT1533 how to put down the volume during the imac startup

    how to put down the volume of startup sound of imac

    Google mute startup sound mac and peruse the results.

Maybe you are looking for