How could I to load my applet from local

hI all,
How can i to load my applet from local file system.
Thanks

Put it anywhere you want. Put the associated HTML file in the same directory as your .class file and double click on the HTML file. Your browser should open up and display your Applet.

Similar Messages

  • ClassFormatError when attempting to load an applet from within a JSP

    Greetings everyone.
    I have a problem that i seem unable to solve.
    I've created a web application. I'm using Java 1.4.2_05 and Tomcat. Right now i'm trying to load an applet from a JSP and i'm getting an error that, try as i might, i can't understand why it happens.
    Here is some detailed info:
    The applet's code:
    package smpb.myapp.controllers;
    import java.applet.Applet;
    import java.awt.Graphics;
    public class GUIApplet extends Applet
         public void init()
         public void stop()
         public void paint(Graphics g)
                  g.drawString("Hey hey hey",20,20);
               g.drawString("Hellooo World",20,40);
    The JSP's code:
    <%@ page language="java"
                   import="java.util.*"
                   session="true" %>
    <%
         String name = (String) request.getSession().getAttribute("userName");
    %>
    <html>
         <head>
              <title>Login</title>
         </head>
         <body>
              <h1><p align="center">Application</p></h1>
              <br>
              Welcome <%= name %>! Thank you for logging in!
              <br><br><br>
              <applet align="middle" code="smpb.myapp.controllers.GUIApplet.class" codebase="./" archive="MyApp_applets.jar">
                   Your browser does not support this feature.
              </applet>
              <br><br>
              <a href='<%=request.getContextPath() + "/LogOut"%>'>Log Out</a><br>
         </body>
    </html>-------------------------------------------
    When i reach this JSP the applet fails to load and i get the following error message at the java console:
    Loading applet ...
    Initializing applet ...
    Starting applet ...
    Connecting http://127.0.0.1/MyApp/MyApp_applets.jar with no proxy
    Connecting http://127.0.0.1/MyApp/MyApp_applets.jar with cookie "JSESSIONID=A8EECE5E39458739C760D8907762C507"
    Last modified time and/or expiration value is not available.  Jar file will not be cached.
    Connecting http://127.0.0.1/MyApp/MyApp_applets.jar with no proxy
    Connecting http://127.0.0.1/MyApp/MyApp_applets.jar with cookie "JSESSIONID=A8EECE5E39458739C760D8907762C507"
    Connecting http://127.0.0.1/MyApp/smpb/myapp/controllers/GUIApplet.class with no proxy
    Connecting http://127.0.0.1/MyApp/smpb/myapp/controllers/GUIApplet.class with cookie "JSESSIONID=A8EECE5E39458739C760D8907762C507"
    Last modified time and/or expiration value is not available.  Jar file will not be cached.
    Connecting http://127.0.0.1/MyApp/smpb/myapp/controllers/GUIApplet.class with no proxy
    Connecting http://127.0.0.1/MyApp/smpb/myapp/controllers/GUIApplet.class with cookie "JSESSIONID=A8EECE5E39458739C760D8907762C507"
    java.lang.ClassFormatError: smpb/myapp/controllers/GUIApplet (Bad magic number)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:157)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:561)
         at sun.applet.AppletPanel.createApplet(AppletPanel.java:617)
         at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1856)
         at sun.applet.AppletPanel.runLoader(AppletPanel.java:546)
         at sun.applet.AppletPanel.run(AppletPanel.java:298)
         at java.lang.Thread.run(Thread.java:534)
    Exception: java.lang.ClassFormatError: smpb/myapp/controllers/GUIApplet (Bad magic number)-------------------------------------------
    The JSP is in the root directory of the web application's path right along with the jar file. The jar file itself has the following structure:
    Archive:  HelpDesk_applets.jar
      Length     Date   Time    Name
            0  05-17-06 12:17   META-INF/
          106  05-17-06 12:17   META-INF/MANIFEST.MF
            0  05-10-06 17:14   smpb/
            0  05-10-06 17:14   smpb/myapp/
            0  05-12-06 16:50   smpb/myapp/controllers/
          794  05-12-06 17:15   smpb/myapp/controllers/GUIApplet.class
          900                   6 filesNow, i've tried loading the very same jar file that i use in the JSP through a static HTML which is virtually identical to the JSP i presented and everything works just fine. I've checked and rechecked to see if all the permissions to access the jar file were accurate, i checked to see if Tomcat had it's MIME settings correctly configured so that there was no chance that the files were being corrupted during the load (as that is a usual cause for the problem, or so i've gathered) but to no avail. I've searched the web, including these forums, and found similar problems but no conclusive solution. I can't seem to figure out, at all, what could possibly be wrong. Does anyone have any ideas? I've tried to be as thorough as i could from the start, so, any help would be deeply appreciated.

    Hi mshah101,
    This can happen if the applet is compiled using an higher version of java and the browser is pointing to an older version (even if minor version number is higher)

  • How can I best load RAW images from a Canon SX50?

    How can I best load RAW images from a Canon SX50?

    9Sorry, ........confused about this process.   When I attempted to Post the question I had entered, I was told a blank space could not be posted.  So, I reentered the Q in the "space"........ which apparently was the space for an answer....!! ??......)
    >  When I try to load RAW images taken by my Canon SX50 from the SD card, iPhoto 11 -  (iMac/OSX 10.6.8) tells me that it can't read the format or something like that.    OSX 10.6.8 came out before the SX50, thus, did not include the related program.           I want to shoot RAW on the SX50....... but I then want to load them into iPhoto....... which I do directly from pics I take with my Nikon D200.  
    Not sure if this will help.............

  • Guys i have a problem, I used to download apps from one of my friends apple id, now i created my new account, but when i was about to update my apps its asks for my friends id and password. now how could i update my old apps from my new apple id?

    Guys i have a problem, I used to download apps from one of my friends apple id, now i created my new account, but when i was about to update my apps its asks for my friends id and password. now how could i update my old apps from my new apple id?

    The_Tonmoy wrote:
    I have no communication with my that friend :/ So it means i need to delete those apps? There's no other solution to update those apps?
    No.  purchases are forever tied to the apple ID used to buy them.  Delete them and buy your own copies.

  • How could I change my telephone number from iMessage ?

    How could I change my telephone number from iMessage ? I've try in my Apple ID and doesn't work.

    Hi,
    On your iPhone Add the Apple ID
    On the Mac then Accept the pop up(s) that appear saying the iPhone is using the ID and iPhone number.
    Untick the old number in the list for Receive At and Start Conversation From drop down if it is the listed item.
    For complete removal you have to delete a .plist or two.
    Open a Finder window
    Use the Go Menu whilst holding down the ALT key
    Select the Library that appears.
    Navigate to the Preferences
    Find com.apple.imservice.imessages.plist and com.apple.imessage.bag.plist and drag them to the Trash.
    Restart the app on the Mac.
    It will ask for the Apple ID.
    It should get the pop ups about the iOS device.
    10:23 pm      Wednesday; November 13, 2013
      iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • How could I erase my telephone contacts from my old iphone4?

    how could I erase my telephone contacts from my old iphone4?

    If your Old Phone was an iPhone... See Here
    http://support.apple.com/kb/HT2109

  • Whit the new iTunes how i can down load my pictures from the iPhone to the computer  to make more spaces

    whit the new iTunes how i can down load my pictures from the iPhone to the computer  to make more spaces

    Hi shadibader,
    I understand that you wish to import your photos onto your computer from your iOS device. Here is an article for you that will explain how to accomplish this:
    Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support
    http://support.apple.com/en-us/HT201302
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • How could i cancel a purshed app from itune store and stop payment from my crediet card

    How could i cancell a purshed app from itune store and stop payment from my vredit card

    Contact iTunes Store support staff through the report a problem links in your account history or,
    iTunes Customer Service Contact - http://www.apple.com/support/itunes/contact.html - Apple states all sales are final, but you can ask.

  • How to tell if loaded file came from cache or not?

    Trying to work out how I can tell if a downloaded file came from the cache or was freshly downloaded over the net. I need this because users will download multiple files and I am trying to give make an accurate downloader for them. I have made them download a sample file which I have made not to cache by doing the following:
    private var _loader:URLLoader;
    private var _rootPath:String; = "http:/example.com/speedTest/f4v/";
    private var _startDownloadTime:int;
    private var _targetSpeed:Number //set elsewhere
    private function loadTestSpeedFile():void
                var fileRequest:URLRequest = new URLRequest();
                fileRequest.url = _fullFilePath + "speedTest.f4v";
                var variables:URLVariables = new URLVariables(); 
                variables.nocache = new Date().getTime();
                fileRequest.data = variables;
                _startDownloadTime = flash.utils.getTimer();
                _loader.load(fileRequest);
    private function speedTestHandler(e:Event):void
                var endDownloadTime:int = flash.utils.getTimer();
                var timeElapsed:Number =   endDownloadTime - _startDownloadTime;
                timeElapsed = timeElapsed/1000;
                var bytesPerSec:Number = (SIZE_OF_TEST_FILE/timeElapsed);
                var currentSpeedFactor:Number = bytesPerSec/_targetSpeed;
                trace("Speed Test file downloaded in " + timeElapsed + " secs at " + bytesPerSec + " bytes a sec : speedFactor " + currentSpeedFactor);
                   //remove this handler and download as normal from a list of files
                _loader.removeEventListener(Event.COMPLETE, speedTestHandler);
                _loader.addEventListener(Event.COMPLETE, completeHandler);
              //download the rest of the files
                download();
    I could work out if the other files are downloading much more quickly (say 20X quicker) than the speedTest rate worked out here and then discount it from calculating the download speed and estimated time remaining.
    However, it would be much better if there was a way to access properties on the URLoader on the Event.COMPLETE handler to see if the file 'downloaded' was taken from the cache or not. Anyone know of way of doing it more elegantly than the hack described in the last sentence?

    Kglad,
    Thanks for the interest and reply. Yes, you are right the file load preventing the file being cached is stictly a different matter from that which is bugging me.  I am, however,  using the Progress Event (as in flash.events.ProgressEvent ) in the following event handler listening to it:
    private function progressHandler(e:ProgressEvent):void
                var percent:Number = (e.bytesLoaded/e.bytesTotal)*100;
                  //other code to resize the gui loader ie scaling it to the percentage.
    Again this just tells me how much has been loaded each time the event is fired. On the Event.COMPLETE handler I am getting the load timings pretty much as per the
    speedTestHandler(e:Event) I posted. The only difference there is that it loads from an array of filenames (most but not all of which can change on later replays - hence some will be cached and some not) What i need to know is where the file is loaded from - either from the server or the local systems cache. The only way round this is to discard very quick downloads (which must be from the cache) from true calculating download speeds but that is a bit hit and miss. I am asking for a better solution. Hope that makes sense...

  • How to load an image from local disk?

    Hi!
    I have spent hours on the net searching for an example, that
    could
    show me how could I make a flex script that user could browse
    (like fileReference.browse() ) for a
    file (picture) and then show this picture in the browser (so
    the source of some existing picture would change).
    I found only multiple solutions on how to upload a picture,
    but
    that is not the thing I wanna do. I want a user to load a
    picture from
    his disk and simply to be seen in a browser (on a page).
    I tried programming it alone, but the FileReference class has
    no attribute path or similar, that I could use for source of my
    image.
    Please help, I need to do this urgently.
    Thank you very very much
    Gus

    OK, I tried without FileReference, simply by changing String
    variable of the source path when calling image.load(path), but it
    works ONLY FOR REMOTE pictures (online), I also tried with
    [Bindable]
    [Embed(source="C:/somePicture.jpg")]
    public var _img0:Class;
    , but it appears that you CANNOT CHANGE THE PATH DOURING
    EXECUTION (dinamically)
    So please, someone?
    Is it even possible to do that?
    I could try uploading picture and then downloading, but why
    would I need a server side if I don't need it...
    Help

  • Newb - Loading an applet from a specific location (local) help please

    Hi guys,
    I am not familiar with java applets at all, we have a 3rd party solution, for which i need a ...... solution
    There is a website v4.globalmentoring.com/clientJava/clientlogin.asp
    on this site, if you click on a topic, and then select "Get Instructor help" link
    you will be taken to a new window (this is a chat window)
    if you "view source" of that code you will see it has some extensive java loading params etc..
    The deal is this, currently you have to go to the site to download the applet (install it on your machine) - and if you look into your Java Console
    you will see that the applet loaded and cached fine...
    The problem is this - some clients do not have rights to install Java Applets from websites, so i was thinking ... if i can give the necessary jar,cab,etc.. files to the client and the client places the files in a folder on a local network, then on the site i could point to a "local folder" to retrieve all the java information...
    here is what i'm thinking:
    //--------------------------- existing code start ------------------------------
    <applet id=appRemovable class="listappNoMargins" code="com.chatspace.v400321.Chat" archive="cfs40321.jar"
    mayscript
    width="100%" height="400" codebase="/ChatSpace/Java" name="cs">
    <param name="cabbase" value="cs3fu.cab">
    <param name="useslibrarycodebase" value="cfs40321.cab">
    <param name="useslibrary" value="ChatSpace Full Java Client 4.0.0.321">
    <param name="useslibraryversion" value="4,0,0,321">
    <param name="namespace" value="nav4">
    .// some parameters.. lots of em..
    <param name="vdir"               value="/clientJava/">
    </applet>
    //--------------------------------------------- END ------------------------------------
    What would i have to change above to make it point to a different location?
    such as lets say C:\myApplet\ ?
    thnx

    MORE INFO:
    put it this way , there are 100's of work stations that do not have rights to download/install applets - what needs to happen is for the network admin
    to set up a network directory where the applet (and all necessary files)
    will be stored, then on my website, i want to point to an applet on THEIR (the client's) network. so they can actually "download" as they have rights to run applications from local network.
    is this fairly clear?
    thnx

  • How could I add a spanish voice from text-to-Speech?

    I like the text-to-speech function. But there is no Spanish Voice. How could I add  a Spanish voice to it? I use Captivate 5.5.
    Your reply will be greatly appreciated.

    Using iPhone, iPad, or iPod with multiple computers - http://support.apple.com/kb/HT1202 - You can manage your iPhone, iPad, or iPod with multiple computers as long as you have set the device to "Manually manage music."  -  E.g., adding music from a second computer to an i-device. Additional information about switching sync mode - https://discussions.apple.com/thread/4435531 and manually adding in iTunes 11 https://discussions.apple.com/thread/4597408

  • How could we read the XML data from a table using BODS.

    Hi Guys,
    My requirement is , As the OLTP system  consists of a table called person which consists of a column demographics. so how could i read this XML data which is in one column of an SQL table called persons. As this XML data will populate the remaining fields in my target using BODS.
    Regards,
    Amjad.

    Hi Amjad,
    I am afraid there ain't any direct method to extract XML field from a data base.
    Indirect way could be converting the whole table (instead of one field) into XML format and then extract one field from it!!
    Regards,
    Mubashir Hussain

  • How to import and display an applet from JSP

    i m using netbeans 5.0
    i have class named myapplet.class
    and jsp named myjsp.jsp
    now i want to access(import) this myapplet.class from jsp
    also i want to display this applet from this jsp
    i am able to do either thing but not both
    so please help me it is so urgent and important for me bcoz
    i have to complete my project as early as possible
    Thanks in advance

    my jsp source file page path is D:\Reliance
    project\WebApplication3\web\
    and classes path is D:\Reliance
    project\WebApplication3\build\web\WEB-INF\classes\
    so problem is that if i want to use myapplet.class
    then i have to put my class in D:\Reliance
    project\WebApplication3\build\web\WEB-INF\classes\
    location
    but at that time i am not able to display this applet
    on my jsp
    if i put my myapplet.class in
    D:\Reliance project\WebApplication3\web\ then i m
    able to display
    applet but not able to access(import) this class
    hope you will got the problem!!!
    thanks for your reply !!!try to set the path of your applet on jsp something like this
    "WEB-INF/classes/myclass.class"

  • How do I access *load paragraph styles* from the styles pallet menu?

    Adobe help informs me that I can bring styles from other documents into an existing document by doing this:
    "To copy paragraph styles from one publication to another choose Load Paragraph Styles from the Paragraph Styles panel menu."
    I do not see any menu in the paragraph style menu. I am in CS5. What am I missing?

    I'm sorry, I found it. I had to go back to my G4 and the CS version to see what to do. I did not recognize the small feature on the window yielding the menu.

Maybe you are looking for

  • ADF ProcessScope -- I get a new AdfFacesContext on each page load

    I am trying to store some variables in the ADF processScope. But the next time the page is loaded and calls the managed bean methods, the AdfFacesContext is different, and so the processScope is empty. The managed bean is session scope, and I am sett

  • I can't import P2 footage

    I have an old project that needs some changes. The footage I need to add was never imported the first time around. When I go to the log and transfer window, I can't add the P2 folder for this project, or any project for that matter. I'm using FCP 6.0

  • Cheque and amount details

    Dear all, I need to create a new report which dipslays Number of cheques issued for each bank on last day and total amount of all the cheques. we different bank accounts at different branches. and also have to display the amount remained in each acco

  • Query regarding Mobility configuration

    Hi All, I have some queries regarding mobility configuration. I have to two WLC's; one Cisco 5508 & another Cisco 4402. My queries are: 1. I have configured both the WLC's in same Mobility domain & same Mobility group but with different Management IP

  • Encrypted .dmg won't mount after upgrade to Snow Leopard

    Just upgraded to Snow Leopard and having trouble mounting an encrypted disk image that I use for my confidential files. I have tried mounting using both DiskImageMounter.app and the Disk Utility but both give error 60008, unable to attach. Anyone els