Deploying an Applet Tutorial

Hi,
I followed the instructions for the creating an applet and deploying it tutorial in JDEV 3.1.1.2. The applet works in the IDE but when I try to run it from the browser, IE just hangs and Netscape 4.7 gives a "Data Applet notinited" message.
In the example, the tutorial was ambiguous about whether the profile name should be different from the name of the profile for the application module since the default name in both cases was Profile.prf. I made the names different.
Is there something that I have to change in the html file?
Thanks in advance.
Peter

a file named swingall.jar is there in
jd jfc\lib directory.copy that file to
your applet html folder and add a proper
plug-in it will work.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Peter H():
Hi,
I followed the instructions for the creating an applet and deploying it tutorial in JDEV 3.1.1.2. The applet works in the IDE but when I try to run it from the browser, IE just hangs and Netscape 4.7 gives a "Data Applet notinited" message.
In the example, the tutorial was ambiguous about whether the profile name should be different from the name of the profile for the application module since the default name in both cases was Profile.prf. I made the names different.
Is there something that I have to change in the html file?
Thanks in advance.
Peter<HR></BLOCKQUOTE>
null

Similar Messages

  • How to 'deploy' an Applet when class files are on client machine?

    Hi all,
    I've searched through these forums and I can't find where my specific question has been asked before, so please accept my apologies for any duplication.
    I am trying to develop an applet for use on an intranet. (The specific requirement is that the applet must operate a scanner, and upload the scanned images to the database - we want it to be an applet so that it seamlessly integrates with the rest of the web application from the user's POV).
    Therefore the applet needs to run outside of the sandbox, but I don't want to go to all the hassle of getting a certificate from Verisign and signing the applet - that doesn't seem like it should be necessary, since there is no problem getting access to the client PC to install the class files by hand!
    I have read on this tutorial page that applets "that are loaded from the local file system (from a directory in the user's CLASSPATH) have none of the restrictions that applets loaded over the network do," so I don't think I am barking up the wrong tree:
    http://java.sun.com/docs/books/tutorial/deployment/applet/security.html
    That is exactly what I want to do! But whenever I try to run the applet, I get a no class definition found exception. However, if I run the applet as a standalone application (using its static main method) then the JRE has no trouble locating the class file - so I know that my CLASSPATH environment variable is set ok.
    Therefore I think the problem must be in my JNLP file. This is what mine looks like at present:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://localhost:8080/JGNS008" href="http://localhost:8080/JGNS008/scanner-applet.jnlp">
        <information>
            <title>Scanner Applet Prototype</title>
            <vendor>Fooware</vendor>
        </information>
        <resources>
            <!-- Application Resources -->
            <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" />
            <jar href="ScannerApplet.jar" main="false" />
        </resources>
        <applet-desc
             name="Scanner Applet Prototype"
             main-class="uk.co.fooware.ScannerApplet"
             width="72"
             height="20">
         </applet-desc>
         <update check="background"/>
    </jnlp>How do I rewrite this so that it doesn't try to download the class files from the network?
    Many thanks,
    Richard.

    richardwild wrote:
    ..I am trying to develop an applet for use on an intranet. (The specific requirement is that the applet must operate a scanner, and upload the scanned images to the database - we want it to be an applet so that it seamlessly integrates with the rest of the web application from the user's POV).
    Therefore the applet needs to run outside of the sandbox, but I don't want to go to all the hassle of getting a certificate from Verisign and signing the applet - that doesn't seem like it should be necessary,.. Code can be digitally signed without a 'verified' certificate from Versign.
    ..since there is no problem getting access to the client PC to install the class files by hand!
    I have read on this tutorial page that applets "that are loaded from the local file system (from a directory in the user's CLASSPATH) have none of the restrictions that applets loaded over the network do," so I don't think I am barking up the wrong tree:
    http://java.sun.com/docs/books/tutorial/deployment/applet/security.html
    Huh. I had never heard of that, but since I do not have access to my end user's classpath it is not that important to me.
    BTW - I am guessing they mean the path indicated by [http://pscode.org/prop/all.html?prop=java.class.path].
    And putting classes into JRE folders seems very hackish to me.
    That is exactly what I want to do! But whenever I try to run the applet, I get a no class definition found exception. However, if I run the applet as a standalone application (using its static main method) then the JRE has no trouble locating the class file - so I know that my CLASSPATH environment variable is set ok.Huh?
    Therefore I think the problem must be in my JNLP file. Huh?!? Why not deploy the applet using a standard applet element? The only way to configure an applet using a JNLP is ..
    a) If the applet is intended to be free floating.
    b) If the applet is intended to be embedded in a plug-in2 architecture JRE. Why impose that restriction, when it seems unnecessary and unproductive?
    Note that the second option is very new, and I would not expect all the things mentioned in the document you linked, to apply equally to JNLP embedded applets. If you want this applet embedded, I suggest you drop the entire JNLP approach and use a standard applet element.

  • FYI: Deploying Infobus Applet

    This is a response to multiple posts on problems with deploying
    the Infobus Applet tutorial.
    When you create your applet.jar file, here are some explicit
    steps to follow when using the Deployment wizard, followed by
    some general notes on deploying applets:
    1. Select Project->Deploy->New Profile from the menu.
    2. Click Next to get past the Welcome page, then accept the
    default 'Deploy to Simple Archive' and click Next.
    3. On the Rules page, click << to shuttle all the rules back to
    the left. We won't use the rules, but will explictly select
    which source files to include from our project on the next page.
    Click Next.
    4. On the Sources page, select your HTML file, XML file, and
    Applet java file and click > to shuttle them over to the right.
    Click Next.
    5. Here is where things get tricky in the deployment phase. For
    this specific tutorial. You do NOT want to include dependency
    classes in your archive since you will deploy those separately.
    Therefore, you want to ADD the oracle.dacf, oracle.jbo and javax
    packages to the list of packages to EXCLUDE from the archive:
    a. Click the Exclude button to display a list of packages.
    b. Expand the oracle node and select the dacf subnode.
    c. Click OK. Notice that oracle.dacf is added to the list of
    packages to exclude from your archive.
    d. Repeate a-c for oracle.jbo and javax.
    e. The exclusions list on the Dependencies page should now
    include oracle.dacf, oracle.jbo and javax (in addition to the
    original default values)
    f. Click the Preview button to show what will be included in
    your archive. It should ONLY show your .class, .xml and .html
    files from your project, a connection.properties file and the
    manifest.
    6. Click Next.
    7. Enter a name for your archive jar file and click Finish to
    generate it. Click Yes when prompted if you want to deploy now.
    Copy the .jar file and each of the .jar/zip files listed in the
    tutorial to your webserver. If the .jars will reside in a
    different directory than the HTML file that calls the applet,
    then you need to set the CODEBASE tag accordingly (relative path
    from the HTML file to the archives).
    Most of the archives you need to deploy are in the redist
    directory. The classes111.zip file you deploy depends on which
    driver you used, but by default will be in jdbc/lib/oracle8.1.5.
    Basically, you want your applet archive file to contain ONLY the
    class and xml files for your applet, and you want to deploy all
    other 'referenced' archives separately (and list each of them in
    the ARCHIVE tag of your applet's HTML file). This provides a few
    benefits:
    * your applet archive is much smaller because it doesn't
    include all referenced class files
    * if you have multiple Infobus applets, you only have to deploy
    the commonly referenced archives once, not package them with each
    applet and deploy them over and over which takes up space on the
    server
    As a side affect of the above deployment strategy, you have to
    explictly tell the deployment wizard to EXCLUDE these referenced
    packages that it would normally try to include in your archive.
    That is accomplished on the Dependencies page of the wizard as
    described above.
    The Preview button will show you what is included. From there,
    you can determine which packages to Exlcude. Keep checking the
    Preview list to make sure you have stripped it down to the bare
    minimum.
    Hope this helps some.
    L
    null

    Hong,
    Are you using an internationalized operating system and/or
    Browser? This appears to be related to a Resource file which
    contains translated strings.
    L
    Hong (guest) wrote:
    : Hi,
    : I did the same way as you mention below. I get this following
    : error message. I guess it couldn't find this class. I don't
    even
    : know where I can find this class.
    : Thanks
    : Hong
    : These are the error message:
    : Opening
    http://web/java/oracle/dacf/dataset/ResTable_en_US.class
    : no proxy
    : java.lang.ClassFormatError: oracle/dacf/dataset/ResTable_en_US
    : (Bad magic number)
    : at java.lang.ClassLoader.defineClass0(Native Method)
    : at java.lang.ClassLoader.defineClass
    : (ClassLoader.java:403)
    : at java.security.SecureClassLoader.defineClass
    : (SecureClassLoader.java:101)
    : at sun.applet.AppletClassLoader.findClass
    : (AppletClassLoader.java:144)
    : at java.lang.ClassLoader.loadClass(Compiled Code)
    : at sun.applet.AppletClassLoader.loadClass(Compiled Code)
    : at java.lang.ClassLoader.loadClass(Compiled Code)
    : at java.util.ResourceBundle.findBundle(Compiled Code)
    : at java.util.ResourceBundle.getBundle(Compiled Code)
    : at java.util.ResourceBundle.getBundle
    : (ResourceBundle.java:334)
    : at oracle.dacf.dataset.Res.<clinit>(Res.java:16)
    : at oracle.dacf.dataset.SessionInfo.<clinit>
    : (SessionInfo.java:59)
    : at package1.Applet1.<init>(Applet1.java:207)
    : at java.lang.Class.newInstance0(Native Method)
    : at java.lang.Class.newInstance(Compiled Code)
    : at sun.applet.AppletPanel.createApplet
    : (AppletPanel.java:532)
    : at sun.plugin.AppletViewer.createApplet
    : (AppletViewer.java:759)
    : at sun.applet.AppletPanel.runLoader(AppletPanel.java:468)
    : at sun.applet.AppletPanel.run(Compiled Code)
    : at java.lang.Thread.run(Thread.java:479)
    : JDeveloper Team (guest) wrote:
    : : This is a response to multiple posts on problems with
    : deploying
    : : the Infobus Applet tutorial.
    : : When you create your applet.jar file, here are some explicit
    : : steps to follow when using the Deployment wizard, followed by
    : : some general notes on deploying applets:
    : : 1. Select Project->Deploy->New Profile from the menu.
    : : 2. Click Next to get past the Welcome page, then accept the
    : : default 'Deploy to Simple Archive' and click Next.
    : : 3. On the Rules page, click << to shuttle all the rules back
    : to
    : : the left. We won't use the rules, but will explictly select
    : : which source files to include from our project on the next
    : page.
    : : Click Next.
    : : 4. On the Sources page, select your HTML file, XML file, and
    : : Applet java file and click > to shuttle them over to the
    : right.
    : : Click Next.
    : : 5. Here is where things get tricky in the deployment phase.
    : For
    : : this specific tutorial. You do NOT want to include
    dependency
    : : classes in your archive since you will deploy those
    : separately.
    : : Therefore, you want to ADD the oracle.dacf, oracle.jbo and
    : javax
    : : packages to the list of packages to EXCLUDE from the archive:
    : : a. Click the Exclude button to display a list of packages.
    : : b. Expand the oracle node and select the dacf subnode.
    : : c. Click OK. Notice that oracle.dacf is added to the list
    : of
    : : packages to exclude from your archive.
    : : d. Repeate a-c for oracle.jbo and javax.
    : : e. The exclusions list on the Dependencies page should now
    : : include oracle.dacf, oracle.jbo and javax (in addition to the
    : : original default values)
    : : f. Click the Preview button to show what will be included
    in
    : : your archive. It should ONLY show your .class, .xml and
    .html
    : : files from your project, a connection.properties file and the
    : : manifest.
    : : 6. Click Next.
    : : 7. Enter a name for your archive jar file and click Finish to
    : : generate it. Click Yes when prompted if you want to deploy
    : now.
    : : Copy the .jar file and each of the .jar/zip files listed in
    : the
    : : tutorial to your webserver. If the .jars will reside in a
    : : different directory than the HTML file that calls the applet,
    : : then you need to set the CODEBASE tag accordingly (relative
    : path
    : : from the HTML file to the archives).
    : : Most of the archives you need to deploy are in the redist
    : : directory. The classes111.zip file you deploy depends on
    : which
    : : driver you used, but by default will be in
    : jdbc/lib/oracle8.1.5.
    : : Basically, you want your applet archive file to contain ONLY
    : the
    : : class and xml files for your applet, and you want to deploy
    : all
    : : other 'referenced' archives separately (and list each of them
    : in
    : : the ARCHIVE tag of your applet's HTML file). This provides a
    : few
    : : benefits:
    : : * your applet archive is much smaller because it doesn't
    : : include all referenced class files
    : : * if you have multiple Infobus applets, you only have to
    : deploy
    : : the commonly referenced archives once, not package them with
    : each
    : : applet and deploy them over and over which takes up space on
    : the
    : : server
    : : As a side affect of the above deployment strategy, you have
    to
    : : explictly tell the deployment wizard to EXCLUDE these
    : referenced
    : : packages that it would normally try to include in your
    : archive.
    : : That is accomplished on the Dependencies page of the wizard
    as
    : : described above.
    : : The Preview button will show you what is included. From
    : there,
    : : you can determine which packages to Exlcude. Keep checking
    : the
    : : Preview list to make sure you have stripped it down to the
    : bare
    : : minimum.
    : : Hope this helps some.
    : : L
    null

  • Deploying my applet

    hello everyone.
    I have spent the morning reading up on how to deploy my applet but i am just getting frustrated. I had no success trying to create the jar file for my applet. All i kept getting was 'bad command of filename' in the command line. But i don't need a .jar to put my applet in a html page right? All i need is the .class file and the one image I am using?
    I put the 'Applet1.class', the picture, and the html page in the same directory but i was hoping if someone could explain why i am not viewing it. here's what i have in the applet tag:
    <applet
    code = "Applet1.class"
    width = "400"
    height = "300"
    hspace = "0"
    vspace = "0"
    align = "top"
    >
    </applet>
    I just don't understand how to deploy my applet. I am using JBuilder 5 Personal and in it's tutorial it says that the "JDK must be on your path" but i don't know how to do this in the command line! I never learned DOS so my knowledge of it is merely navigational and Borland's site is just horrible for finding answers. (at least for newbies)
    Please help me.
    I have three files: the .class, .gif, and the .html in the same directory. How do i put them together?
    getting sad,
    -cloudtwist-

    1. check your classpath to see whether it is correct for both your java commands as well as your working directory
    2. make sure that your .html is pointing to the correct directory in which your .class file resides.
    3. it could also be that you might not have the proper java plug-in in your browser window. You can atleast momentarily avoid this problem by implementing the applet below which you can view in an appletviewer.
    you can try this very simple applet to check how an applet works. Note that in this I have put the html code along as a comment and it should be run with the command "appletviewer basicapplet.java" after compilation. You don't need a .html file for this.
    If you are getting
    import java.awt.*;
    import java.applet.Applet;
    /*<applet code=basicapplet.class
    width=300
    height=300>
    </applet>*/
    public class basicapplet extends Applet{
    public void paint(Graphics g){
    g.drawString("Hello from Java", 80, 120);

  • How to Deploy an Applet successfully?

    I tried the tutorial in the JDeveloper 2.0 Beta. Everything
    worked fine. I could run the applet within the JDeveloper. I
    completed the section on deploying the applet. When I started
    running the applet using IE, I got the following message "load:
    tutorial.EmpApplet can't be instantiated" and the program
    stopped. What could be the problem? How do I deploy my applet?
    null

    when deploying application i am getting
    java.lang.ClassFormatError.borland/jdbc/dataset/Dataset
    (local variable name has bad constant pool index)
    can ya please reply soon;
    JDeveloper Team (guest) wrote:
    : Bernard,
    : By 'Js2', I assume you mean JDeveloper 2.0 Beta? If that is
    the
    : case, then the deployment wizard can be found as follows:
    : Select New from the File menu to display the New Gallery.
    : Click on the Deployment tab (may have to click on right arrow
    : (->) to view all the tabs in the New Gallery.
    : I think the one you want for applets is the Simple Archive.
    : Double-click on the type of deployment you want to start the
    : deployment wizard.
    : Note: This will be changing slightly in 2.0 production.
    : Deployment will be available from the Project menu instead of
    the
    : new Gallery, and all deployment wizards will be incorporated
    into
    : one, where you choose the deployment type on the first page of
    : the wizard.
    : -L
    : Bernard Polarski (guest) wrote:
    : : I could manage to run in netscape an applet that connect to
    my
    : : 7.3.4 DB, but I used Kawa on the JDK 1.1.7b of Sun. For
    jsuite,
    : : the problem is that borland & Oracle redefine many java
    classes
    : : of Sun and you must bring these new classes with you in a
    Zip
    : or
    : : Jar file. The problem in Js2, is that I did not found a
    : : deployment wizard to help create a zip file containing all
    the
    : : predefined classes. This wizard exists in Jbuilder2 but I
    could
    : : not manage to find it in JS2. Suppose it come in next
    version.
    : : B. Polarski
    : : JDev team (guest) wrote:
    : : : Looks like the appletviewer does not have access to the
    : : : borland.jbcl.* classes. Did you choose to check the
    borland.*
    : : : classes for dependencies before generating the archive?
    : : : Also check the .html page to see if the <archive> tag is
    : : there.
    : : : Hope this helps.
    : : : Regards
    : : : JDev Team
    : : : Worm (guest) wrote:
    : : : : TK Cheng (guest) wrote:
    : : : : : I tried the tutorial in the JDeveloper 2.0 Beta.
    : : Everything
    : : : : : worked fine. I could run the applet within the
    : : JDeveloper.
    : : : I
    : : : : : completed the section on deploying the applet. When I
    : : : started
    : : : : : running the applet using IE, I got the following
    message
    : : : : "load:
    : : : : : tutorial.EmpApplet can't be instantiated" and the
    program
    : : : : : stopped. What could be the problem? How do I deploy
    my
    : : : : applet?
    : : : : I got the same message in IE 5.0, "Failed to load" in
    : : Netscape
    : : : : 4.5, and finally tried HotJava 1.1.5 and got:
    : : : : "File not found when looking for:
    : : : : borland.jbcl.dataset.StorageDataSet
    : : : : null:
    : : : : java.lang.NoClassDefFoundError".
    : : : : If anyone knows how to fix this PLEASE let me know.
    : : Worm
    null

  • How to deploy an applet textbased?

    Hello Evrybody,
    I want to deploy an applet but I have 2 problems.
    * It has to be textbased, no gui.
    * It is after a authentication page.
    Is there a browser (or other way) of deploying such a applet?
    With kind regards
    Arnoud

    Cindy C. knew this one:
    (pg 197 in the j2ee tutorial.pdf)
    You can also create application-specific subdirectories (that is, package directo-ries) in either the document root or the WEB�INF/ lasses directory
    Note: When you add classes and archives to a WAR, deploytool automatically packages them in the WEB1/2INF subdirectory. This is correct for Web components and server-side utility classes, but incorrect for client-side classes such as applets and any archives accessed by applets. To put client-side classes and archives in the cor-rect location, you must drag them to the document root after you have added them to the archive.

  • How deploy javafx Applet in Tomcat

    Hi all!
    Please help me. How i can deploy JavaFX Applet in Tomcat

    Are you using Netbeans or SDK?

  • Deploy infobus applet--"Invalidating certificate principals"

    Hi, lots of questions about deploying infobus applet had been
    posted previously, but none of them is my case.
    After finishing generating "package1.jar", I copy every *.jar,
    *.zip file into my deploy directory "c:\temp" as well as the
    package1.applet1.html. But while I open this html file in
    Netscape 4.7, no applet appear. In the java console, the
    following error message appear..
    Invalidating certificate principals in [file:/C|/temp/try/,]
    Can the applet be invoked without webserver?
    I had tried to transfer the whole directory to the website(sun
    webserver), the same error message appear( only change is the
    path now is [155.69.60.117:88])
    Can anyone tell me why?
    thx
    null

    This is hardly an Advanced Language Topic, nor is it Java-related. And who uses Netscape? I'm just playing with you. No but seriously, nobody is gonna answer that here. This is a JAVA forum.

  • Deploying an Applet

    hey there,
    if created a applet with which you can send SQL statements to a Oracle Database and then see the results in a nice swing table (JTable). If Only used the connection manager to acces the database. In the JDeveloper environment this works very nice.
    My problem starts when I want to deploy the Applet somewhere else. The error i'm getting in my iExplorer statusbar (after using the deployment wizard) is:
    load: package1.MainApplet cant be instantiated.
    if got some experience with java and using jars and stuff. I'm pretty sure it's not that (I've tried basicly everything I could think of.
    Is it possible that this error occurs because I'm not running it from the database computer. I thought that it just wouldn't be able to log on to the database. (the logon secuence starts after clicking a button so I expect it would be able to start)
    please let me know what you think even if you think it's of no help, dialog often helps you know
    thanks
    Erik
    [email protected]

    Hi,
    It looks like you are not using BC4J in your applet. There are some bugs there for the 3.1.1 release, but not the ones you are getting.
    The most important thing for deployment of an applet is:
    1. Deploy EVERYTHING that your applet needs to the server. This includes the applet classes themselves, as well as dependency libraries such as the classes12.zip file for the connection, rt.zip, etc. Best thing to do here is to select your project in the Navigator, and choose Properties ... from the right-mouse menu. Now click the Libraries tab. Here you will see a list of libraries. All of the jar/zip files that make up these libraries need to be deployed with your applet to the webserver.
    2. If you have deployed all of your dependency libraries to the webserver, you will need to make sure that the HTML file that contains the applet tag correctly lists all of the jars/zips in the ARCHIVE tag. Note that if you are using the JDK 1.2 plugin (you should), then the ARCHIVE tag appears MORE THAN ONCE in your HTML file. Open that file in a text editor and make sure the ARCHIVE list is correct for ALL instances of the tag.
    Here are some good generic applet references to check:
    Borland JBuilder doc: http://www.borland.com/techpubs/jbuilder/jbuilder3-s/pg/applets.html
    JavaSoft Plugin Download: http://java.sun.com/products/plugin/
    JavaSoft Applets Resources Page: http://www.javasoft.com/applets/index.html
    null

  • How to deploy database Applets

    I use JDeveloper to build applets. What is the best way to
    deploy database applets to the 9iAS Portal?
    marcel

    My application is targeted toward home users with an Internet connection but minimal computer knowledge. It is not clear to me how I could install and configure a database server using WebStart, and doing it manually would hopelessly overwhelm my target audience. So I opted for a simple embedded PureJava database which stores information in ASCII files.
    I have several such files containing product data catalogs which I need to transfer using WebStart and write to a standard, platform-independent directory (i.e. no C:\ or such) which my JDBC URL can then access. I can pack my data files into a JAR and programmatically extract them on the client side. However, the problem is finding out what the application's client-side default path is in order to save my files to a standard location. It appears that the default path is the Windows Desktop the first time the app is started, but changes to the application's home directory (C:\Program Files\Java Web Start\.javaws\cache\...\myApp) thereafter.
    Any hints or suggestions?

  • Deploying Signed Applet to my users

    Hello,
    I have a signed applet from Thawte and it runs good on my machine, but I have the prblem of trying to deploy the applet to other users on other machines. What is the steps needed so that I don't have to change the java.policy file on their computers. This applet will run on a server that the group has access to.

    Develop a HTML or JSp to point to download the Applet Class and ask the Users to access the Html Page... now the Applet would have downloaded to the User Machines and it will do the job u wanted to do...

  • Run and Deploy JavaFX applets on Linux Fedora

    Hi all,
    This is a step by step, how to run and deploy JavaFX applets on Linux/Fedora
    http://java-javafx-iipt.blogspot.com/2009/04/run-and-deploy-javafx-applets-on-linux.html
    Hope you find it useful.
    Kaesar ALNIJRES

    Something like this should workjava -cp /path-to-external-jar:SMSClient.jar TheMainClassWhen you use the -jar option, the -cp option is ignored. If you want to use -jar, you can add a Class-Path entry into theSMSClient jar's manifest with the relative path to the external jar.

  • Mass deployment of applet (jar)

    In order to deploy an applet en-mass when using the Microsoft JVM for IE I run the command below in a login script. How would I do the same when using the SUN JVM - note that SUN JVM uses .jars instead of .cabs.
    Thanks
    rundll32 c:\winnt\system32\msjava.dll,JavaPkgMgr_Install c:\temp\jvue.cab,0,0,0,0,0,0

    For example : If a company of 400,000 people wish to
    use an online software application which uses 3
    applets why burn your bandwidth downloading the same
    applets 400,000 times.. Hence the mass deploy
    solution.Downloading it via a login script already 'burns' bandwidth.
    And if it is set up correctly the applet is only downloaded once, the first time it is used. And after that it is downloaded only when it changes.

  • Applets in Applet Tutorial Fail

    I am trying to work through the tutorial on applets. Every page in this tutorial with an applet in it fails to load the applet. For example, when I load http://java.sun.com/docs/books/tutorial/deployment/applet/browser.html I get the following error:
    General Exception: javal.lang.NoClassDefFoundError: ShowDocument$1
    at ShowDocument.init(ShowDocument.java:22)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source).
    This happens in both Firefox and IE.
    According to the coffee cup that appears in my taskbar when I load a page with an applet, I am running J2SE 1.5.0_04-b05.
    Other applets, incuding some in other parts of the tutorial, work fine.
    Any suggestions would be much appreciated.

    Sounds like you're copying the compiled classes
    somewhere, but aren't copying the complete set of
    them.
    ShowDocument$1 -- there should be a
    ShowDocument$1.class file where you compiled
    ShowDocument.java -- you need to include the above
    class file in your build as well.Go to the link posted. That is a Sun Tutorial page. The applet fails to load with this stack trace.
    java.lang.NoClassDefFoundError: ShowDocument$1
         at ShowDocument.init(ShowDocument.java:22)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception in thread "thread applet-ShowDocument.class" java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletException(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    This is more Sun crapola.

  • Trouble with applet tutorial about servers

    I downloaded the sources of this (http://java.sun.com/docs/books/tutorial/deployment/applet/clientExample.html) example and am trying to make them work. However I'm having trouble with the server program.It compiles fine but when I run it I get NullPointerException in QuoteServerThread class on this line:
    packet = new DatagramPacket(buf, 256);buf is a byte array and it's set to null.
    I don't have any experience with networking in java so if the problem is something really simple you'll know why I didn't find it.
    Oh, and the code of the thread is here http://java.sun.com/docs/books/tutorial/deployment/applet/examples/QuoteServerThread.java

    Replace
    byte[] buf = null;with
    byte[] buf = new byte[ 256 ];Other problems may happen if this sample was not tested properly.
    The problem is that the DatagramPacket requires you to supply a non-null buffer, as per:
    DatagramPacket
    public DatagramPacket(byte[] buf, int length)
    Constructs a DatagramPacket for receiving packets of length length.
    The length argument must be less than or equal to buf.length.
    Parameters:
    buf - buffer for holding the incoming datagram.
    length - the number of bytes to read.
    Edited by: baftos on Jul 18, 2008 3:38 PM

Maybe you are looking for