Why does this applet (with an audio clip) fail to load in a browser?

Hello Java Experts.
I am able to compile and run the applet in an IDE. The problem lies when I attempt to run the applet through a browser (such as Internet Explorer, Firefox, etc.). The entire applet fails to load (in the browser) when it includes code pertaining to audio clips, but works fine when it does not contain audio clip related code.
Here is a Short, Self Contained, Compilable, Example that illustrates my problem:
import javax.swing.*;  //  Required libraries
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class Music extends JApplet  //  Music class is a subclass of the JApplet class
    AudioClip music;
    public void init ()
        music = getAudioClip (getCodeBase (), "sample.wav");  //  You may use your own audio file
        music.loop();
    public void paint (Graphics g)
        g.setColor (Color.blue); 
        g.fillRect (0, 0, 800, 600);  //  THIS RECTANGLE IS NOT DRAWN (this is my test to see if the applet loads in the browser)
}Please try to run this applet in a browser so that you can point me to my mistake(s).
Thanks for the help in advance.

>
Here is a Short, Self Contained, Compilable, Example that illustrates my problem:>The 'example' part of it, fails to manifest here. Using that exact code, I was able to see a blue rectangle in both AppletViewer and FF. You might try..
1) Configuring the Java Console to open for applets by default - look in it for error messages.
2) Change the name of the WAV to something that definitely +does not exist+ at the code base. (That would most closely replicate my own testing experience - since there is no WAV available here).

Similar Messages

  • Why does this big download keep saying mounting failed?

    I'm downloading the Windows 7 beta and it gets to about 550 mb and then it says mounting failed. I was kind of paying attention to it right when it did it and I'm pretty sure that the HDD started up then stopped then it said that but I'm not totally sure. Any ideas?

    All it is is an iso that you burn to a disc. From what I read, it works just fine using BootCamp. Besides, it's just downloading it, not running it so that is not the issue.

  • I have created a PDF with mp3 audio clips, the file works on PC's with audio playback (WIndows 7, 8 ) however the audio does not play when hosted on a website or an ipad/tablet computer or smart phone when used with PDF reader

    I have created a PDF with mp3 audio clips, the file works on PC's with audio playback (WIndows 7, 8 ) however the audio does not play when hosted on a website or an ipad/tablet computer or smart phone when used with PDF reader

    adobe42135678 wrote:
    the audio does not play when hosted on a website...
    When viewing in what browser?

  • In addition to my home page, every time I start Firefox a tab opens with notifacation of an updated addon. Why does this tab continue to appear even though there is no updated version of the addon?

    In addition to my home page, every time I start Firefox a tab opens with notification of an updated addon. Why does this tab continue to appear even though there is no updated version of the addon?

    See these articles for some suggestions:
    *https://support.mozilla.com/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox
    *https://support.mozilla.com/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols
    *http://kb.mozillazine.org/Preferences_not_saved

  • Why does fcpx suddenly stop reading audio files? ever since i upgraded to Yosemite. Than when I check it on my hard drive it doesn't work as well. Only this file. Am in a trouble of delivering now. Any help?

    why does fcpx suddenly stops reading audio files? ever since i upgraded to Yosemite. Than when I check it on my hard drive it doesn't work as well. Only this file. Am in a trouble of delivering now. Any help?

    Could be systems logs or some other system file growing.
    Use OmniDiskSweeper or DaisyDisk to map what's being used.
    Regards,
    Shawn

  • Why does this stupid Apple TV not recognize my itunes account when I put in my ID and password???  I've had nothing but problems with it.

    Why does this stupid Apple TV not recognize my itunes account??

    if you mean home sharing then
    home sharing is not set on the appletv but on the itunes program on the computer which lib one wish to share
    the home share password need not be the appleID password as homeshare is also meant to share your media with others on your LAN network whom you may not wish to know your appleID password
    so home sharing password is set seperately in ituens on your computer

  • We're sorry, we are unable to continue with your activation at this time. why does this do this? i need help

    We're sorry, we are unable to continue with your activation at this time. why does this do this? i need help please.

    Activation issues are typically the result of a device that has been hacked or jailbroken.  Is this the case?

  • When I use Siri with Voiceover on my iPHONE 4S. Voiceover will not respond to any finger jestures. Why does this happen?

    When I use Siri with Voiceover on my iPHONE 4S. Voiceover will not respond to any finger jestures. Why does this happen?                                           

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • TS4062 when i sync my iphone a large portion of my music does not download but rather stays in the cloud. then i must download it from the cloud. why does this happen and how can i stop it from happening

    every time that i sync my iphone with a cord to my imac some large portion of my music is placed in the cloud so that i must down load it from the cloud. this includes music that i have purchased on itunes and other music. it seems random.
    why does this happen? is it a setting? i want to stop it. and music that w

    It was gift back in September. You can follow the instructions in the link below to remove them:
    Remove iTunes gift album "Songs of Innocence" from your iTunes music library and purchases - Apple Support

  • My iphone is suddenly populated by random songs I've downloaded in the past. Why does this happen, and what are apple doing about fixing this?

    Why does this happen?
    What do other people do? (I can't go to sleep knowing there's a rogue album or song in my music. It's 2am now)
    What do we tell apple so that they actually fix it. None of us want to pay £25 to have our own music.

    I am on the monthly payment plan because nobody at BT has told me there is any alternative!
    Each year there I have a long, in-depth conversation with the person who sets up the contract for the next year but the gist of the thing is 'I'm  not going to be paying more than [x amount] per month, am I? Because I can't afford any more'' and each year the person says that no, in fact I should be paying less... and then without notice and even with the bill saying 'We will continue to take....' a totally different - and higher - sum disappears from my bank account.
    Then I go through the painful process of writing to complain about this, get some sort of sum refunded and then the payments go through at the level they should, with me paying any additional (usually small) amounts for usage over the allowance. Until contract end when we start all over again...
    Even if the amount they seem to randomly decide on is based on some sort of forecast, this should not be happening as I am doing what they instruct me to do on the bill to keep my payments the same.
    So something is going wrong, on many levels.
    At no point have I been offered the sort of 'monthly billing' described here; maybe there is some reason I am not allowed it. Unfortunately 'whole bill' direct debit payment is beyond me. I really need to know what I will be paying each month and I need BT to correctly take that amount, as agreed, each month, from the get-go.
    It shouldn't be that hard really! Does anyone from BT read these forums? Can somebody take this on and finally get this straight, please?

  • HT2500 I sometimes get e-mails where the sender sends me several PDF's attachments. These attachments appear already opened on the e-mail unlike most PDF's which I open by clicking on the PDF icon. Why does this happen?

    I sometimes get e-mails with pdf attachments. However instead of opening a PDF icon the body of the e-mail message has the PDF's already opened. Why does this happen? Is there anything I can change on my mac book pro to make these PDF's come thru with their individual icons which can then be opened.

    This is a long-standing design flaw in Apple Mail.
    Prior to Mavericks, this command in Terminal would stop the annoying behavior:
    defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes
    This Terminal command stopped working in Mail 7.1 under Mavericks. I have reported this to Apple as both a feature request and a bug. You should too.
    http://www.apple.com/feeback

  • HT5007 Why does this app stop at about 10 seconds into a selected trailer then resume on it's own?

    Why does this app stop and resume?

    I believe the OP is asking about the Apple iTunes Movies Trailer app, so it is an Apple app.
    I think maybe the video playback catches up with the download and until the download resumes, the video is stopping. Just a guess at this point.

  • While trying to instal Mountain Lion OS on my macbook pro, I got the error message that my HD was damaged and it reverted to my Lion OS. Why does this happen? I bought the OS online through the app store

    While trying to instal Mountain Lion OS on my macbook pro, I got the error message that my HD was damaged and it reverted to my Lion OS. Why does this happen? I bought the OS online through the app store.

    The Mountain Lion installer looks at your internal drive to make certain that it's error-free before continuing installation. You should have an application named "Install OS X Mountain Lion.app" in your Applications folder now so you shouldn't have to download it again. Do this...
    Boot to your Lion recovery partition by holding down both the Command and the R keys while booting. Open Disk Utility from the Recovery partition and select your hard drive (usually named "Macintosh HD" unless you've renamed it) and click on Verify Disk. If you come up with any errors, click on Repair Disk. At the end of the cycle you will get a message that the disk was successfully repaired or a message that the hard drive could not be repaired.
    If you're able to repair the disk, just reboot as normal and open the "Install OS X Mountain Lion.app" and the installation will proceed. If Disk Utility was unable to repair the disk, you need to get to your local Apple Store as soon as possible so that they can see if the disk is salvageable or beyond repair.
    Good luck,
    Clinton

  • The monitor of my MacBook Pro suddenly became all black, I tried to reset but it did not work, what should I do? Why does this happen?

    The monitor of my MacBook Pro suddenly became all black, I tried to reset but it did not work, what should I do? Why does this happen?

    I advise to reply to the one you want to reply to.
    You have had good information here. I will not repeat that here.
    I would like to add:
    you have incompatible software: start in SafeMode, read Woodmeister and see if it is free of issues.
    Akamai is crap software needed or not, Huawei the same.
    It is very possible that the keygenerator you used for generating a key for some softwares has infected your mac.
    The non-regular software with the false key(s) are not compatible probably or generate malware. Luckily you can not update them automatically because the keygenerator blocked the software for contacting the developer... I propose to consider getting rid of those softwares by really good uninstalling.
    You have a beautiful mac, don't degenerate it with crapped software. There are alternatives for expensive software, for example Adobe Photoshop has a free alternative (with a less beautiful interface) in GIMP. And so on.
    Lex

  • Why does compressor settings of aac audio, stereo, create 2 channel mono from 2 discrete audio channel movies?

    Why does compressor settings of aac audio, stereo, create 2 channel mono from 2 discrete audio channel movies?

    well depending on how your audio is brought into your system you can select it as two streams of mono or a stereo pair. In reality, unless it's mixed in stereo, that's just two streams of mono locked together. Other streams brought in via other means, can have a lot more audio channels, e.g. 8, 16, 24.
      In your case, with what you're doing, two separate channels works best, so you can control the levels of two very different audio sources. If, for instance, you were taking the feed from the mixing board during a concert, you might want their stereo out. Otherwise you might be dealing with the 1.2 zillion channels that they're mixing live.
       I like separating the tracks coming in. I work with people who prefer to lock them together. Locking means the tracks move together during editing. Ok, fine, but I'm usually dealing with different audio sources, like you are: a camera mic (safety on location) and a close mic (shotgun, lav). Or I have a shotgun source and a lav. I want to determine the best source audio for the shot. Sometimes it's a lav, sometimes a different feed from somewhere else, sometimes the shotgun, and sometimes a mix of two sources. But if they're locked together and pre-set to come out evenly from both speakers there no way for me to make a determination. The other guys like to cut and figure out the audio later.
      To each his or her own. . .

Maybe you are looking for

  • HP Color LaserJet Pro MFP ME PCL 6

    I've been using the printer for about 1 month and no problems.  Just tried to print a document and now its printing with color lines thruout the page horizintally.  checked my cartridges and it shows they are more than 50 % full.  

  • Global colour changes

    Hi, I saw a tip for changing text attributes across multiple Text layers by linking them, then holding shift on any one of the linked layers to apply the attributes (colour, font, size) to all. However this doesn't work for me in CS6, and was wonderi

  • Error in Service Starting

    I enter below command and it has below text : C:\Users\Administrator>emctl status dbconsole Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0 Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved. https://BRGSoft:5501/em/co

  • Error in importing user-created jar file & cannot find symbol

    Hello. I try to import the jar file made from common classes in the previous project. by using NB 5.5.1. The jar file is named as 'tpslib.jar' The previoud package name is 'tps'. I added tpslib.jar in the library, and removed the class files from the

  • Automatic Service purchase requisiton from sales order

    Gurus, We have a business scenario where , service purchase requsition needs to be created automatically from a sales order. Could you please let us know whether anybody has worked on this scenario ? Kindly also suggest if any workaround can make thi