APPLET CODE WITH PACKAGE

Hello,
I have o code in a package and I do not know how to write the html file the code parameter is not enough I think. Do I have to add package=myapplication?
Thanks in advance
This is my html file
<applet code="myapplication.class" >
</applet>

Let's assume that your Package is named package1 and your applet class file is named applet1.
Now you must place your applet1 in a folder package1.
Now, the html file looks like this
<applet code="package1.applet1" width=300 height=200>
</applet>
You don't need to use codebase if you are in the root directory of the package.
Get Your Java apps rated - http://www.thejavahub.com
Find Great Java Applets, Applications & Servlets - http://www.thejavahub.com

Similar Messages

  • Need Applet code - pleae help

    Hi all, I'm relatively new to the Java applets technology and i apologise in advance if I am posting this in the wrong forum.
    I am trying to develop a applet base utility to perform database backups etc , to run within our network.
    I am looking for a applet code with following functionalities.
    1 - show unix directory to choose for backup
    2 - create script and run database commands.
    Please send this code to me, or point me to the url from where I can download, I have tried everywhere I could not find.
    Thanks in advance.
    my email [email protected]

    I would recomend that you first look into Servlets, I think this would a better solution.
    Check this link:
    http://java.sun.com/webservices/docs/1.0/tutorial/doc/Servlets.html

  • Help with packages and classpath

    Heya,
    first off, i use textpad to compile my java, i don't do it via the command line.
    my problem is faily simple, i think. i've got a main class and i'd like it to import a custom class from a subdir.
    Main class is in
    C:\Documents and Settings\David\Desktop\java\test_gen.java
    I would like it to import
    C:\Documents and Settings\David\Desktop\java\obj_data\objects.java
    I understand that I have to declare objects.java to be a part of a package, so i head the code with: package obj_data; as i understand it, the directory in which the package to be imported resides in will be named the same as the package.
    When i import my package into test_gen.java, i import obj_data as follows:
    import obj_data.*;
    this should import objects.class and any other classes in the same directory. also import obj_data.objects.*; could be used.
    Anyway, thats my understanding of how you set up the class and package; i also understand that when the java file compiles the compiler looks at the directoy(s) indicated in the class path for the classes to import. that in mind i tried to add:
    C:\Documents and Settings\David\Desktop\java\obj_data\
    to my classpath. i did this via dos, javac -classpath "C:\Documents and Settings\David\Desktop\java\obj_data\"
    i got no error messages, so i assume it worked. however when i try to compile the main java (test_gen) i get-
    package packages does not exist
    import packages.*;
    ^
    1 error
    Tool completed with exit code 1
    can anyone give me some help please?

    This is a minimal explanation of packages.
    Assume that your programs are part of a package named myapp, which is specified by this first line in each source file:
    package myapp;
    Also assume that directory (C:\java\work\) is listed in the CLASSPATH list of directories.
    Also assume that all your source files reside in this directory structure: C:\java\work\myapp\
    Then a statement to compile your source file named aProgram.java is:
    C:\java\work\>javac myapp\aProgram.java
    Explanation:
    Compiling
    A class is in a package if there is a package statement at the top of the class.
    The source file needs to be in a subdirectory structure. The subdirectory structure must match the package statement. The top subdirectory must be in the classpath directory.
    So, you generate a directory structure C:\java\work\myapp\ which is the [classpath directory + the package subdirectory structure], and place aProgram.java in it.
    Then from the classpath directory (C:\java\work\) use the command: javac myapp\aProgram.java
    Running
    Compiling creates a file, aProgram.class in the myapp directory.
    (The following is where people tend to get lost.)
    The correct name now, as far as java is concerned, is the combination of package name and class name: myapp.aProgram (note I omit the .class) If you don't use this name, java will complain that it can't find the class.
    To run a class that's NOT part of a package, you use the command: java SomeFile (assuming that SomeFile.class is in a directory that's listed in the classpath)
    To run a class that IS part of a package, you use the command java myapp.aProgram (Note that this is analogous to the command for a class not in a package, you just use the fully qualified name)

  • Mozilla 1.7.x  hangs in applet code on RH Linux with JRE 1.5.0

    Hi all,
    From my applet code when an URLConnection.getInputStream() method is called the browser hangs, if authentication is turned on the webserver.
    This works with jre 1.4.2 on linux, for the matter on windows with Jre1.5 also.
    Also it works on 1.5 if suthentication is not set.
    So it is this particular combination of (jre1.5/mozilla on linux/authentication) that doesnot work :):).
    I tried to set the auth header, but nothing seem to help.
    String login = "userid"+":"+"password";
    String encodedLogin = new sun.misc.BASE64Encoder().encode(login.getBytes());
    httpsCon.setRequestProperty("Authorization", "Basic " + encodedLogin);
    Searched on the sun/mozilla sites to see if any known issues, couldn't find any.
    Thanks
    RT

    Just to add upon that a simple code like this will hang
    String str = "https://ppp.qqq.com/admin/50_splash.gif";
    try {
    URL url = new URL(str);
    URLConnection con = url.openConnection();
    HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
    con.setDoInput(true);
    try {
    con.connect(); //-->hangs here
    It looks to me like at this point plugin tries to popup the authentication dialog box but it cannot.
    Thanks
    RT

  • Help with simple applet code

    i wanted to write a applet that would display a image,(this is my first program) i wrote the code shown below,but image space is emptly when i load it up with any browser.....i ran the code in netbeans,,, i am a novice, any piece of advice also wud be helpful.........
    <applet code="imagereadingapplet" width=500 height=500>
    <param name="img" value="kollam.gif">
    </applet>
    import java.applet.*;
    import java.awt.*;
    * @author raman
    public class imagereadingapplet extends Applet {
    * Initialization method that will be called after the applet is loaded
    * into the browser.
    Image img;
    @Override
    public void init() {
    img = getImage(getDocumentBase(),"kollam.gif");
    @Override
    public void paint(Graphics g){
    g.drawImage(img,0,0,this);
    // TODO overwrite start(), stop() and destroy() methods
    }

    Hi,
    First advice imagereadingapplet -> ImageReadingApplet (Java name convention).
    Second image file name is hard coded so you don't have to set param for the applet (Best would be not to hard code this name).
    Finally maybe the most interesting, It seems that image kollam.gif is not at root folder.
    I don't really know netbeans but your image must be in bin folder, the same as imagereadingapplet.class.

  • Applet development with JDeveloper

    Hi,
    After many years of not being on the Java bandwagon, I am now faced with having to learn Java for some small projects that I will be working on later this year.
    I have been working through the newest Core Java book. I am currently at chapter x, Applets.
    My question is, How do I run applets from within JDeveloper?
    For example, given the following code:
    package myapplet;
    <applet code="MyApplet.class" width="300" height="300">
    </applet>
    import javax.swing.*;
    public classMyApplet extends JApplet
    public void init()
    JLabel label = new JLabel("Not a \"Hello, world\" applet", SwingConstants.CENTER);
    add(label);
    How can I run it from within JDev or how can I run it in a applet viewer or regular web browser? I tried to execute it in a Firefox browser, but it does not work.
    Thanks for any help you can give me.
    Ron Reidy

    Try this:
    In JDeveloper from the new->web tier->applet create a new applet (check the "can run stand alone").
    Add your 2 lines of code to the jbinit method.
    Then you can just run the applet directly.
    The other option is if you don't check the "run stand alone", you'll go into the new->web tier->applet and create an Applet HTML. The wizard will guide you to selecting your applet. then you run the HTML page.

  • Problem with packages and findClass()

    Im trying to make a loader for java project it runs fine from a batch file with this inside it.
    @echo off
    java -classpath rscdaemon.jar;lib/xpp3.jar;lib/xstream.jar;lib/hex-string.jar com.rscd.client.mudclient rscdaemon.org
    pause
    {code}
    now when I try to load it from java with URL for JAR ZipEntity loading
    loading the Jar from URL with
        private JarFile jar;
    [code]
        public loader(String archive) throws IOException {
            URL u = new URL("jar:" + archive + "!/");
            JarURLConnection jurl = (JarURLConnection) u.openConnection();
            jar = jurl.getJarFile();
    [/code]
    Here is the jar url if anyone is wondering
    http://24.185.39.150:8081/rscdaemon.jar
    {code:java}
    String value = "com.rscd.client.mudclient.class";
    Applet app = (Applet) loader.loadClass(value.replaceAll(".class", "")).newInstance();
    {code}
    The loader worked before when the java jar wasn't in packages now it stopped working.
    {code:java}
        public Class<?> loadClass(String string) throws ClassNotFoundException {
            Class c = null;
            try {
                c = super.findSystemClass(string);
            } catch (ClassNotFoundException cnfe) {
                try {
                    ZipEntry zip = jar.getEntry(string.replaceAll("\\.", File.pathSeparator) + ".class");
                    int size = (int) zip.getSize();
                    byte buffer[] = new byte[size];
                    if (size == (new DataInputStream(jar.getInputStream(zip))).read(buffer)) {
                        c = defineClass(string, buffer, 0, buffer.length);
                } catch (Exception e) {
                    e.printStackTrace();
            if (c != null) return c;
            return super.loadClass(string);
    {code}
    The error I get is this
    {code:java}
    java.lang.ClassNotFoundException: com.rscd.client.mudclient
            at java.lang.ClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
    {code}
    anyone know whats the problem?
    I'd really LOVE yah if you can help me out.
    Edited by: protosstribe on Sep 23, 2007 5:41 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    In fact, I hope it's<APPLET code="test/jtest.class" width=100 height=100></APPLET>

  • Applet use with HTML// also appletviewer question

    I am new to the language. I am trying to start an applet in a folder that I created on my hard drive(C:). I have included the following code in my HTML in my folder.
    <applet code="NotHelloWorldApplet.class"
    width= "300" height= "300">
    </applet>
    I have already compiled the program; I have the net beans 1_4_2 compiler, and it has compiled without errors.
    The code is :
    import java.awt.*;
    import javax.swing.*;
    public class NotHelloWorldApplet extends JApplet
    public void init()
    Container contentPane = getContentPane();
    JLabel label = new JLabel("Not a Hello, World applet",
    SwingConstants.CENTER);
    contentPane.add(label);
    I have also downloaded Plug-In; if that means anything. When I open the HTML folder a grey box appears; then at the bottom of the window it says that it cannot find the file; even though the file exists(I have looked with the file finder and it is in my file directory). Is it in the wrong directory? How does the file folder in windows know how to run and execute a java program with the preceding HTML code. This is the method explained in a current text book that I am using. It tells me to
    1. to compile the source code into class files.
    I used the compiler and I successfully created a .class file, (obviously the title of the program is .java program, but the class file does exist.
    Then 2. add the above code in the HTML program(which I did).
    I would like to get applets running but do not know how to correct this problem. Is there more HTML code that I need to run a java program in the folder's code.
    Also, the textbook I am using tells me to preview the applet with appletviewer. I loaded the appletviewer into the editing screen and it is a bunch of hieroglyphics. One of two possible problems are that it is not included with the Net_Beans_1.4.2(it was from another download) or the download was contaminated. Anyway, the question I have is; is appletviewer an application that is viable with Net_Beans_1.4.2 and if it is from where and how do I run or execute it to preview my applets before I run them inside an HTML document.
    Derk_the_Zeeman
    [email protected]

    Sounds to me like you're having trouble with NetBeans, not applets or appletviewer. You should consult their docs on how to access their version of appletviewer.
    It also sounds to me like you're using the book CoreJava by Horstmann/Cornell.
    Notice that they package TextPad with their book. This is for a good reason. It is very easy to be suckered into thinking you know what is going on when you have an IDE that does stuff for you. I know. I programmed in VB for a while, and I thought I knew how to do Windows programming. But I didn't. VB was doing all the work for me while I was drawing boxes on the screen and patting myself on the back. It took several major blows to the ego before I found out that all I really knew how to do was how to draw a bunch of silly boxes.
    New programmers should start out with a text editor. They get a better feel of what is going on.
    I don't know how NetBeans works -- even now I prefer TextPad over any IDE I've tried. But appletviewer works in the same way the java and javac command works, except that the argument it takes is the name of the html file which contains those applet tags (<APPLET>).
    I have some thoughts on your problem:
    1) you have an html file somewhere, but you don't know where. It is somehow created in a "window". the tag
    applet code="NotHelloWorldApplet.class"
    means "look in this directory for the class NotHelloWorldApplet.class" So if the html file you have created is not in this directory, how will appletviewer (or NetBean equivalent) know where it is? (hence, "class not found")
    2) Is this correct? You have downloaded the plug-in for your browsers, but you didn't try using your browsers to see the applet?
    If so, try this: go to IE or Netscape (or whatever you favorite browser is) and try in IE File-->Open and hit the browse button, or in Netscape File--> Open File
    Next, try to find the file "NotHelloWorldApplet.html" or whatever it is you called the "window". Open the html file.
    If it doesn't work, check to see if the html file is in the same directory as the class file (repeat procedure, but now look at files of type "All")
    3) You can make an html file with notepad. You don't need anything special. Just type in the html code that Horstmann/Cornell include into notepad and save as an html.
    Does this help?
    :) jen

  • Appletviewer not compitable with Package

    Hi All,
    I have created a package javaProg.completeReferance. and use this same package to execute all of my java application however when I try to execute an applet it complains.this is how I execute applet.
    appletviewer javaProg.SimpleApplet.html (or .class), but when I remove all the packages statement and go to the current Dir it executes perfectly . So can I concule that appletviewer is not complitable with packages.
    below is the simple code. Any help is highly appreciated.
    package javaProg.completeReferance;
    //<applet code="SimpleApplet.class" width="200" height="200"></applet>
    import java.applet.Applet;
    import java.awt.*;
    public class SimpleApplet extends Applet
         public void paint(Graphics g)
              g.drawString("Hello World",20,20);
    }

    I am using window vista and I read somewhere that
    vista and java together , in the Applet programhave
    few bugs.
    Regards!Your chance of finding a true Java bug increases as
    your java experience increases. On the other hand,
    99.999% of 'bugs' reported by newbies are actually
    bugs in the newbie's own code.sorry about that actually Java rocks.I am preparing for my SCJP , Can you please tell me is the exam very difficult to crack and also how much time is actually required for a noviceto crack this .This will be very helpful for me as I can plan according.
    Thanks in advance!!

  • Applet and Apache Package

    My applet works up until it needs to use classes found in the Apache HttpClient package - the java console displays an error stating that classes from the Apache package cannot be found. The entire java console error message is below. I don't understand why the Apache package cannot be found. When I run the code as an app from eclipse or from the java command line, the code works just fine - there is no problem finding the Apache package. Anyone know what I'm missing?
    Applet tag:
    <applet code="projects.web.UploadApplet" archive="../applets/webtools.jar" width="700" height="600"></applet>Java console error message:
    Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity
    at projects.web.AppletGUI$ButtonHandler.actionPerform ed(AppletGUI.java:169)
    at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.methods.RequestEntity
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 25 more
    Caused by: java.io.IOException: open HTTP connection failed:http://xxx.xxx.xxx.xxx/site/php/org/apache/commons/httpclient/methods/RequestEntity.class
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unk nown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(U nknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknow n Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 29 more

    paulcw wrote:
    Since the JVM is going to look on the web server (since that's where it found the HTML and the applet class to begin with), that's not going to work then, is it?No, it isn't going to work. The root of this problem was a fundamental misunderstanding I had about the compile process. I mistakenly thought that when any source code is complied the compiler checks the imported packages and classes to see if they are java library classes and if not then it adds them to the compiled code. So, when the error message indicated that the server was searching for the classes (in the jar file) I was confused as to why/where it was searching. After re-reading my notes I realize that I was completely off on the compile process.
    paulcw wrote:
    Yeah apparently you can set the classpath for applets, although I can't recall the syntax. (I believe the easiest way is to package your applet's class files into a jar, and use a Classpath attribute in the jar's manifest, but honestly I don't recall. Check the docs.)I looked into the docs and found out you can change the classpath by modifying the manifest file. According to the doc you create a txt file and use the "m" option during archiving to add it to the manifest file.
    I created a txt file that has the classpath information like so:
    Class-Path: ../apache/commons-httpclient/commons-httpclient-3.1.jar ../apache/commons-logging/commons-logging-1.1.1.jar ../apache/commons-codec/commons-codec-1.3.jar ../apache/junit-4.5.jarand added it to the manifest file via jar cfm jarFileName inputFiles
    Thanks paulcw.
    Edited by: Dan06 on Mar 31, 2009 1:44 PM Issues with modifying the manifest file were resolved by re-starting my computer.

  • How do I update a file in an Applet's JAR file from the Applet code

    Here's my problem.
    My applet is using a serializable history data in which I am storing in the applet's JAR file. When I run the applet, I read the file with "getResourceAsStream()" and run my program with that hist data. When my applet is closed, I need to update this file from my Applet's code and I dumfounded about how to do that.
    Is there any way to update a file in the Applet's JAR file through the Java Applet code? (i.e. OutputStream?).
    Would appreciate any advice people have.

    Just place a copy of the file on the local hard disk and update that. When you start the Applet you try to read from the hard disk. If the file exists then no problem otherwise copy it from the jar to the hard disk.

  • Issue with Packaged Jars added to project from resource Palette

    Hello!
    I am using Jdeveloper 11.1.2.2.
    I started this post thinking there was an issue having to do with packaging jars that refer to other libraries (see post Are Libraries Required?
    Now I realize it is a different issue (although that other post is relevant).
    Issue: I create a package -- a template in this case.
    I deploy it in my file system and then load it into the resource palette as a file system connection.
    I create a new application. From the resource palette, I add the jar to the view controller project, and am able to use the template in jsf files. No problem. Runs fine.
    then I load the application into subversion or I move the whole application to another directory on my computer.
    When I open the moved application (or do a checkout from subversion), I open the jsf that contains a reference to the jar, the design view is completely blank. Going to the source, I see my original code, but there are red signals in the upper-right signifying an error.
    If I run the application without fixing it, I get an error saying the template cant be found, Also, when I deployed to a standalone weblogic server, I get the same error (see the post above for this error).
    I open the project properties. The ADF Library is in the "Libraries and Classpath" and pressing edit, I can see the correct reference to the path of the jar.
    To make the application work, I have to remove the ADF Library (or at least the reference when pressing edit) and then from the resource palette, add it again to the project.
    IS THIS NORMAL? Am I doing something wrong with the initial packaging of the jar? Should I change some setting somewhere?
    How am I supposed to deploy to weblogic?
    The other posting shows an error output if I try to run the application before fixing the jar reference. I got the same darn error when deploying to weblogic.
    Would appreciate any help!
    Stuart
    Edited by: Stuart Fleming on Nov 18, 2012 4:45 AM

    Timo,
    thank you for your reply. I actually created a youtube video on this, available here: http://youtu.be/ERyLngq9hlI
    Since the video might be a little tedious to view, Here are the details. You can jump to the exciting parts of the video, if you want:
    Here is what I did:
    1. I cleaned out my system directory and the temp directory on my computer.
    2. Opened the application containing my template. Deleted the existing jar file.
    3. Started taking video....
    4. (From 40 seconds into the video) Created the jar file again.
    5. (2:55 minuts into video) Closed template applcation and Created new fusion application.
    6. (4 minutes into the video) Created model
    7. (4:15 minutes into video) in view controller added template, created a jsf page.
    8. (5 minutes into the video) Created Security and users.
    9. (6:30 minutes into the video) Created a task flow, with jsff in it, with a form on the jsff. Assigned Security to objects.
    *10. (7 minutes into the video). Ran JSF successfully.*
    11. (7:40 minutes into the video). Closed application. Copied the entire application into two directories.
    12. (8 minutes into video) Opened the first copied video. You can see that the jsf page is not accessing the template. Reviewed the View Controller project Libraries and classpath. Removed the library, re-added the jar from the resource palette. Worked fine.
    13. (9:30 minutes into video). Opened the 2nd copy of the file I intend for subversion. Showed the jsf page and the error it displays when open (same as in first copied application).
    Load application into subversion.
    14. (10 minutes into video). Check out application
    15. (10:15 minutes into video). Open JSF file. The reference to the template jar file is reading properly.
    16. (11 minutes into video). Load the original working copy into subversion.
    17. (11:30 minutes into video). Check out from subverion, but the check out failed.
    18. (12 minutes into video). Check out, and look at the jsf.  The page shows fine.
    Timo, I think this might be reported as a bug. You ought to be able to move files around on your computer. Also, the first time I checked the application out from subversion, the jsf page did not read the template.
    ALSO, when I tried to deploy the application (that contained the reference to the template jar file to weblogic), I got the same error when I ran the jsf
    first lines of that error:
    Error 500--Internal Server Error
    java.io.FileNotFoundException: /WEB-INF/ssfTemplate/SSFTemplate.jsf Not Found in ExternalContext as a Resource
    at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:224)
    Thank you for your time and commitment!
    Stuart
    Edited by: Stuart Fleming on Nov 18, 2012 10:13 AM

  • Call applet method with javascript

    my html - code:
    <APPLET NAME="Mail" ... ... ></APPLET>
    <form action="javascript:document.applets("Mail").test("Execute JAVA Applet Function")">
    <input type="submit" value="Execute Applet Function">
    </form>
    my applet code:
    public void test(String t)
    {System.out.println("executing test()");
    teststr = t;
    repaint();
    in the paint() method i draw the teststr with Graphics.drawString - but nothing happens...
    any suggestions?
    thx

    Directly calling a Java Applet's public method from within
    JavaScript is made possible by LiveConnect which is not implemented by Internet Explorer as of yet. LiveConnect is only available on Netscape navigator at this time.

  • A problem with packages...

    Hi,
    I have just started learning how to create packages. I think I have the directory structure correct and I know I hav eplaced the correct class file in the correct place...but when I try to compile another class (one which uses the class I placed in my package) the compiler complains that it cannot find the first class.
    Here's some truncated code which might help to explain...
    class Item {
        package com.eoghain.ecommerce;
        //code with methods for this class
    class Storefront {
        package com.eoghain.ecommerce;
        //this class instantiated a new item and passes values to it
    class Giftshop {
        import com.eoghain.ecommerce.*;
        //this class uses storefront and item classes
        //to build up an inventory for the shop
    }Item has compiled accurately and I placed the class file in the directory structure c:/java/dev/com/eoghain/ecommerce/Item.class
    I have set the Classpath to include c:/java/dev so I think the compiler should be able to find Item.class. When this didn't work, I also placed Item.class in the directory containing Storefront.java...but Storefront.java still did not compile and the compiler could not find Item.class.
    Any ideas on what I am doing wrong?
    Thanks in advance,
    Eoghain

    Hi kajbj,
    Thank you for the quick response!
    Unfortunately, I have not been able to compile either Storefront.java or Giftshop.java yet as they both need to use an Item object and my compiler cannot seem to find Item.class.
    When I said 'compiled accurately'...I should have been clearer and pointed out that only Item.java compiled accurately.
    I wrote the psudocode in my first post from memory...when I go home I can post the code in it's entirety, if that would help. Which part of the Giftshop.java class is incorrect? If it's the absence of any variables or methods - that was intentional because I just wanted to give an idea of the structure of the application.
    I think the major problem is that when I try to instantiate a new Item object, in Storefront.java, the compiler can't seem to find the relevant files.
    -Eoghain

  • Applet in a package

    Hi,
    I have my main applet inside a package such as:
    package temp;
    import java.awt.Container;
    ...However, when I tried to call it from the browser as:
    <applet code="HelloWorld.class" width=500 height=500>
    <blockquote>
    <hr>
    You can't run applets,
    so here's a picture of the window
    this applet brings up:
    </blockquote>
    </applet>the applet.htm file is in the same folder as the Applet. However, this gives my a problem and i cannot see the applet :(
    do you have some ideas?
    Marcelo

    try <applet code=test.HelloWorld.class ...

Maybe you are looking for