Very new, issue with applets not loading

Hello, thanks in advance for any assistance provided.
I am having trouble getting any applet that I create to run in my browser. I have tried using both Netbeans and Eclipse as the IDE. Most of my testing is in a .htm file on my desktop pointing to a .class file also on my desktop, but I have also tried hosting both of them on a webpage with the same results.
The HTML I'm using is
<HTML>
<HEAD><TITLE>
HTML Test Page
</TITLE></HEAD>
<BODY>
Test
<HR>
<applet code="HelloWorld.class" width="420" height="210">
</applet>
</BODY>
</HTML>The code in the .class file is from http://java.sun.com/docs/books/tutorial/deployment/applet/getStarted.html :
import javax.swing.JApplet;
import java.awt.Graphics;
public class HelloWorld extends JApplet {
    public void paint(Graphics g) {
     g.drawRect(0, 0,
             getSize().width - 1,
             getSize().height - 1);
        g.drawString("Hello world!", 5, 15);
    }The error message I get in my browser is
java.lang.ClassCastException: HelloWorld cannot be cast to java.applet.Applet
     at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
     at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassCastException: HelloWorld cannot be cast to java.applet.Applet
Can anyone explain what I'm doing wrong in terms a java noob could understand? Thanks alot.

Even though I tried that multiple times before, it seems to be working now. I think my issue must lie with me being confused by what I'm supposed to name the package and the main class and all that. Thanks Paul.

Similar Messages

  • Hi all, I've got very unpleasant  issue with my iPhone 4s on ios 5.1 - it can automatically turn on the 3G even if my local operator does not have the 3g coverage. What I should do to solve this problem? (p.s. even want to jail it!!!))

    Hi!
    I've got very unpleasant issue with my IPhone 4s, it can automaticaly turn on the 3G even if my local mobile operator does not have 3G coverage.
    I hate it, 'cause my battery dies in a couple of hours. How can I solve this problem. It is very annoying. I just thinking about jailing!!!
    Thanks in advance.

    There are NO carriers that legitimately offer the iPhone in Ukraine according to this list: http://support.apple.com/kb/ht1937
    I'm not talking about carriers that support 3G, I'm talking about AUTHORIZED iPhone carriers. There is NO SUPPORT available for iPhones on networks other than those who are authorized BY APPLE to carry the iPhone.
    The iPhone should work with any compatible GSM carrier. If your carrier is not on the list I linked to, you will have to work with them to resolve any problems. There is nothing else anyone can do for you.

  • Help with Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    This was all working yesterday, but this morning, I cannot run in the dev fabric, or even setting the website project as a startup project directly, I get the following error:
    Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.BadImageFormatException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Assembly Load Trace: The following information can be helpful to determine why the assembly 'msshrtmi' could not be loaded.
    === Pre-bind state information ===
    LOG: User = Andrew-VAIO\Andrew
    LOG: DisplayName = msshrtmi
    (Partial)
    WRN: Partial binding information was supplied for an assembly:
    WRN: Assembly Name: msshrtmi | Domain ID: 3
    WRN: A partial bind occurs when only part of the assembly display name is provided.
    WRN: This might result in the binder loading an incorrect assembly.
    WRN: It is recommended to provide a fully specified textual identity for the assembly,
    WRN: that consists of the simple name, version, culture, and public key token.
    WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
    LOG: Appbase = file:///C:/Users/Andrew/Desktop/Beko2011Azure/Website/
    LOG: Initial PrivatePath = C:\Users\Andrew\Desktop\Beko2011Azure\Website\bin
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\Users\Andrew\Desktop\Beko2011Azure\Website\web.config
    LOG: Using host configuration file:
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/cb955b02/eef106e2/msshrtmi.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/cb955b02/eef106e2/msshrtmi/msshrtmi.DLL.
    LOG: Attempting download of new URL file:///C:/Users/Andrew/Desktop/Beko2011Azure/Website/bin/msshrtmi.DLL.
    ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
    Stack Trace:
    [BadImageFormatException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
    System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
    System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
    System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
    System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
    System.Reflection.Assembly.Load(String assemblyString) +28
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
    [ConfigurationErrorsException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209
    System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
    System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94
    System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677
    [HttpException (0x80004005): Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9079228
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258
    Note that the dev machine is x64 Win7.
    I have not tried deploying this to staging since the issue started as I'm a bit nervous of touching the staging/live environment until this is solved.
    Removing the PlatformTarget element from the project file has no effect
    Removing the msshrtmi.dll file from the bin directory of the website project ends up with 
    'Could not load file or assembly 'Microsoft.WindowsFabric.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified'
    I have used Git to revert to the last working build to no effect (But I don't have the obj/bin folders in GIT), but it has atleast reset the project files etc.
    If I return msshrtmi.dll to the bin folder and switch the model and website projects to x64 there is no change
    If I switch both to x86 then I get an error Could not load file or assembly 'BekoModel2011' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    which is the model project - presumably because to run on my x64 machine I need the 64bit version?
    I really need to be able to debug and then publish some changes ASAP.
    Andrew

    Hi,
    Is it true that you're using IIS to host the application? Could you check whether the process is x64 or x86 one via task manager or config in IIS manager?
    http://blogs.msdn.com/b/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx
    Allen Chen [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Since update, various sites load very slowly and some do not load until "Reload Current Page" is clicked several times.

    Since Firefox update (6.0.2) many sites load very slowly and some do not load at all (green circle rotates infinitely) until "Reload Current Page" is clicked on 2 to 12 times.
    Returned to version 5. No more slow load.
    Automatically re-updated me to 6.0.2 and now slow again.
    Returned to FF 5 again and turned off automatic update.
    Downloaded 7.0.1 and the problem seems to be solved.

    Same here, only that updating to 7.0 or 7.0.1 doesn't seem to solve this issue. Seems to have something to do with loading images (e.g: adobe.com stops loading when "wwwimages.adobe.com" is being loaded. imdb.com, on the other hand, seems to load images very slowly and not all of them).
    Safe-mode. disabling add-ons, clearing cache and cookies and checking for malware doesn't help.

  • Why does FF save files to desktop, when I have "downloads" checked in options? This is a new issue with the latest version 3.6.3 Windows XP Thanks.

    Why does FF save files to desktop, when I have "downloads" checked in options? This is a new issue with the latest version 3.6.3 . Using Windows XP Driving me nuttier! Thanks.
    (Is is that MicroNetFrame Asst thing?)
    == This happened ==
    Every time Firefox opened
    == When I installed latest version

    Thanks for your reply. I appreciate your help.
    It was just a hunch that MircoNetFrame was causing the problem. I disabled it as you suggested, and I still have the problem.
    I just changed under Tools>Options> General - had checked "ask me every time" under downloads, so instead of asking me, FF saved the download to I know not where. It no longer saves it to the desktop, leaving a duplicate in "my documents".
    In windows, I have found unless one knows the entire name of the document, one can never find anything. It isn't listed under recent ''''''__. I can't recall the nomenclature, but the
    capability is ridiculous. So, I don't know where that file I just downloaded is!
    I downloaded a PDF file, but this happens with all DL's. It was so easy to have them all stacked in one place and I could recall
    what I had and when I downloaded it easily.
    Do you have any other suggestions other that going back to the old version of FF, which I would rather not do?
    Thanks again for your time, it is very considerate to help a complete stranger, I must say. Sounds like something I might do! Cheers!

  • New issue with Tiger...

    I'm using Tiger (10.4.10) and all of a sudden I can't open System Profile or download upgrades or new software? Otherwise all is well!
    I use Onyx and Cocktail for general maintenance... usually about once a month or when my Mac slows down.
    I could use some directions

    I'd restore your backup and only perform maintenance with Macjanitor or Anacron if you find you can't leave your machine on overnight at least once a month in Screen Saver. Other functions of Onyx and Cocktail should only be used when troubleshooting very specific issues and should not be used as general maintenance software.

  • How do I fix issue with computer not authorized yet when authorized it indicated already authorized?

    How do I fix issue with computer not authorized yet when I go to I-Tunes to authorized it indicated already authorized?

    I updated to iOS 5.0.1 days ago and didn't receive that notification until just now...
    This time I synced new photos I took yesterday, and it gave me the:
    "iTunes Sync: 54 items could not be synced. See iTunes for more information"
    Perhaps it kicks off when new items get synced.
    I've decided to rent a movie yesterday. Once it gets deleted, I'm curious to see if it jumps to 55 items.

  • Since Nov 11 we have very big issues with our emails received via exchange server. Part of them are empty

    Since Nov 11 all Iphone and Ipad of our company have very big issues with email synchronization. We all synchronized with Exchange server.
    In the past nobaody had issue.
    Some of our users have IOS 6 and others IOS 5
    Messages arrived empty and it is impossible to download them.
    Nobody is able to answer ????
    I have the same issue with my personnal Ipad synchronized with exchange also.

    This resolution have to attend at the server not with the ios device. My employer's mail administrator reject me to correct it from the server. As his concern is, if ither ios devices works why don't mine? So I am helpless than changing my iphone. It works fine for early versions of ios and with androids. And also one of my friends iphone4 with ios 7 (similar as mine) works too. So I guess it's something wrong with my iPhones settings. But basic question I cannot understand is it works in my phone before this ios7 upgrading. And currently working with my yahoo account too. Favourable reply expected.

  • Issue with Calendar not syncing with iPhone 3g

    Issue with Calendar not syncing with iPhone 3g.
    Solution
    Create backup of your entire mailbox before starting (THIS IS IMPORTANT)
    Create offline folder (.pst file) Check windows help on how to do this for your version.
    Open folders view on Outlook
    Right click on Calendar in tree view and 'copy to' offline .pst folder
    Go back to main calendar view and delete all entries in your calendar.
    Create simple cal entry and sync test with iphone
    If this works then start dragging cal entries back from the offline folder into the main calendar then sync after each step....
    I moved events in this order
    -Yearly recurrences (ie Birthdays)
    - Monthly recurrences
    - weekly recurrences
    - Daily recurrences
    All appointments from the beginning of this year >> to the end of time!
    If all these sync then the issue is with an older cal item and you have to decide if you actually need these in you current calendar.
    I chose to leave these in the offline cal and if i need access them from there.
    If at any point the sync fails then you know you have a corrupt cal entry in the block you just transferred. Move the offending items back into the offline folder and try again in smaller chunks until you identify the offending items and delete them and manually recreate them in your real calendar.
    Also smart to run the inbox (.pst /.ost ) repair tools for your OS/Outlook version.
    Fixed so far
    XP Pro / Outlook 2008
    XP Pro /Outlook 2003

    I just updated the firmware to iPhone 2.0.1 and the syncing works great both ways.

  • I have a brand new macbook with microsoft office loaded. I set outlook as the default mail. i would rather go back to mac mail but can't figure out how to do it. any ideas?

    I have a brand new macbook with microsoft office loaded. I set outlook as the default mail. i would rather go back to mac mail but can't figure out how to do it. any ideas?
    Thanks for any help
    Lou

    I have a similar problem: I switched from mac mail to Outlook 2011 as the default client, and want to switch back. Mailto links (eg from browser etc) default to Mail.  However, when I try to email a Word document as an attachment, it continues to open Outlook.  Outlook has a button in its prefs for making it the default client, but I don't see a way to turn this pref off in either Outlook or in Word.  

  • When is the next ios update and will it fix/address the issue with photos not being shown in chronilogical order?

    when is the next ios update and will it fix/address the issue with photos not being shown in chronological order?

    All of us here are users just like you. We have no inside info of when Apple products or operating system updates/upgrades will be released. The next iOS may not even change the issue you have.
     Cheers, Tom

  • I have download firefox 4 beta but now in some websites can not open. applet not load properly

    I just download fire 4 beta on my windows vista. Can not open in some websites. the message applet not load properly please reload the page

    Your More system details list doesn't show the Java plugin as installed.
    Update the [[Java]] plugin to the latest version.
    *http://kb.mozillazine.org/Java
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)

  • When attempting launch of photoshopcc,I get a box with "could not load the MMX core routines module because it does not work with this version of PS... what does this mean and how do I correct it?

    when attempting launch of photoshopcc,I get a box with "could not load the MMX core routines module because it does not work with this version of PS... what does this mean and how do I correct it?

    I did a search on my system and found the Photoshop has a fastcore plug-in.  Creative Cloud includes a subscription version of CS6 version 13.1.2.   I do not know if you installed that or not.  The cc un-install may have done something.  You may need to use Adobe Cleaner then Install The Perpetual CS6 version of Photoshop  CS6 version 13.0.6 Mac or Photoshop  CS6 version 13.0.1.3 PC and not the subscription CS6 extended version 13.1.2.  Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6   If you need to download the CS6 installer Download CS6 products.
    You may also be able to recover your cs6 using an old system backup
    fastcore.8bx on my system...

  • I still am having problems with Aperture not loading,  It just refuses to work, and I get the message saying it has encountered a problem, and I may need to re-install which I have done dozens of times. The fix mentioned on an earlier post wont work as it

    I still am having problems with Aperture not loading,  It just refuses to work, and I get the message saying it has encountered a problem, and I may need to re-install which I have done dozens of times. The fix mentioned on an earlier post doesn't work as it is for Ver 10.6.6 and I am running 10.6.7

    Do you have Final Cut installed on your machine?
    If so, you may want to look at this article: http://support.apple.com/kb/TS3528
    Let us know if that helps.

  • I'm often having issues with clients not seeing or being able to open attachments, font formatting changes (on the pc end) and the inability to use HTML signatures to promote our company brand.

    I'm often having issues with clients not seeing or being able to open attachments, font formatting changes (on the pc end) and the inability to use HTML signatures to promote our company brand.

    I imagine your clients must be using Outlook, which is seriously broken when it comes to e-mail standards, especially HTML e-mail. You can work around the issues with Outlook by only sending plain-text e-mails and making sure that, in the Edit -> Attachments menu, the last two options are checked. Unfortunately, that means that HTML signatures are out.
    If you need something with a fancy layout, either attach a PDF file to the e-mail or include a link to a website in the e-mail.

Maybe you are looking for