Results 1 to 6 of 6
  1. #1
    shwein is offline Member
    Join Date
    Sep 2008
    Posts
    38
    Rep Power
    0

    Default [SOLVED] calling javascript from applet

    hi, its me again...
    i would like to call javascript from my applet but to do this i need to
    "import netscape.javascript.*;". when i enter this code with my imports it is not recognized. should i download an extra library or something?
    i first started a thread with the same issue in 'new to java'.(sry!!, i always tend to do this because i am 'new' to java. Is there a way to delete that thread?)
    thx to all who replies :)

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,457
    Rep Power
    25

    Default

    To use classes in the netscape.javascript package you'll need the jar file containing those classes to be on the classpath when you compile your program.

  3. #3
    shwein is offline Member
    Join Date
    Sep 2008
    Posts
    38
    Rep Power
    0

    Default

    thx norm, but i don't get it...

    "you'll need the jar file containing those classes to be on the classpath when you compile your program."

    wich classes?
    where can i get that jar file? (when i export my applet, this will be the .jar, no?)
    classpath?
    :confused:

  4. #4
    shwein is offline Member
    Join Date
    Sep 2008
    Posts
    38
    Rep Power
    0

    Default

    when i export my applet to its destination folder i also add .classpath and .project. I do not know what they mean but has it somthin to do with those?

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,457
    Rep Power
    25

    Default

    import netscape.javascript.*
    Why do you want this above package?
    Will your code compile without it?
    where can i get that jar file
    Where did you see the reference to the package in the import statement? That place might tell you where to get the jar file with that package.
    If the browser does not have that package, then you will have to add the jar file to the <APPLET tag archive= in the HTML.

  6. #6
    shwein is offline Member
    Join Date
    Sep 2008
    Posts
    38
    Rep Power
    0

Similar Threads

  1. javascript
    By fiero in forum New To Java
    Replies: 1
    Last Post: 09-22-2008, 01:45 PM
  2. Calling a jar Applet in Eclipse
    By chankokchern in forum Java Applets
    Replies: 1
    Last Post: 07-04-2008, 05:35 PM
  3. Java applet and Javascript type problem
    By Interdit in forum Java Applets
    Replies: 0
    Last Post: 05-27-2008, 01:38 PM
  4. Jsp and javascript
    By Ed in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-04-2007, 04:54 AM
  5. javascript validation
    By yuchuang in forum New To Java
    Replies: 5
    Last Post: 05-14-2007, 03:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •