Loading icons during applet class init

I load a bunch of icons thusly:
    ImageIcon[] typeIcons = {
        null,
        createImageIcon("context_icon", "Context"),
        createImageIcon("featureset_icon", "featureset"),
        createImageIcon("format_icon", "format"),
        createImageIcon("raster_icon", "grid"),
        createImageIcon("projection_icon", "projection")
    static ImageIcon createImageIcon(String name, String alt) {
        URL url = FeatureEditor.class.getResource(name + ".png");
        if(url == null)
            throw new IllegalArgumentException("No such image as " + name);
        return new ImageIcon(url, alt);
    }And display them as table cells.
That works ok, but why does it go screwy on me if I make the typeIcons array static? (The TableCellRenderer complains that the objects are of the wrong type).
I can't see why icon loading can't be initiated during class initialisation rather than in object initialisation.

Where the method is defined in the source code won't help- it will get called during the initialisation of the array just as before. Is there really no other class object available that you can use instead for the base of your resources? If there's nothing else in your package, then use Object.class and give the full path, rather than a relative one (assuming you're using the default class loader).
Pete

Similar Messages

  • Show Loading icon during long PPR request?

    Hi,
    I have a 11g taskflow that loads a bpel tasklist which can take some time to load when the user has a lot of tasks. The pagefragment shows the tasks based on a view object. The view object is filled by calling the bpel api over soap which can take some time (did not get the rmi client to work with weblogic). When the view object is filled the UI shows the fetching data text but during loading the view object the UI stays on the calling page and to the user it looks like the application is not doing anything when he clicked the show tasklist page menu item while in fact the page is still loading. Is there a way to show a status/loading icon/component when PPR is loading the pagefragment that contains the task list? The fact that loading takes some time is not an issue but now the user has now idea if there is actually happening something. Showing the loading icon that is rendered at application startup during waiting would be great .....
    Kind Regards,
    Andre

    Hi,
    try af:progressIndicator
    " The progressIndicator component can be used to give users an indication that there is a back end task in progress. A ProgressIndicator's state is tracked by the org.apache.myfaces.trinidad.model.BoundedRangeModel attached to this component through its 'value' attribute. The BoundedRangeModel provides a 'value' and a 'maximum' to the component. If either the 'value' or the 'maximum are negative numbers, the progressIndicator is in an indeterminate state and shows up as a spinner animation. If the 'value' is not negative (and the 'maximum' is negative), the progressIndicator is in a finished indeterminate state and shows up as a stopped spinner. When the 'value' and 'maximum' are non-negative values, the component switches to a determinate mode and renders a progress bar indicating percentage of task completion ('value' / 'maximum'). Each of these various states will show a hover description for that state Once the task is complete, if an 'action' has been assigned to the progressIndicator, then an ActionEvent is triggered.
    The progressIndicator component can be used with a poll component from the page as a partial trigger, in order that it be updated at regular intervals in PPR mode as determined by the pollInterval from the poll component. "
    <af:progressIndicator id="progId" value="#{boundedRangeModel}" />
    value: The data model being used by this progress component. The model should be of type org.apache.myfaces.trinidad.model.BoundedRangeModel.
    Frank

  • MBP stuck on blue screen with spinning loading icon during update to 10.6.7

    I have a mid-2010 model Macbook Pro 13inch, 2.4ghz/4gb ram
    I've been scouring apple forums and even reddit and my googlefu has yielded no such luck. Basically, System Update has been yelling at me for a few weeks now to upgrade to 10.6.7 (among other updates) and I've been putting it off and putting it off, with the intention of eventually doing the update, but I just kept forgetting.
    Finally tonight, I remembered, and decided to open System Update, and do all the recommended updates that it was asking me to do. So, without thinking twice (I've never had an issue with this before) I clicked download and install, and away it went, downloading like usual and then rebooting.
    Thing is, it's been stuck at this blue screen with the spinning spiral coming up on 5 hours now. I know the 10.6.7 update was close to 400mb, but I've never had anything like this happen before.
    My hard drive had more than 150 gigs free on it last time I checked, and it's been running absolutely flawless up until now.
    Has anyone else experienced this? Is it supposed to take so long? What do I do?
    I've been contemplating shutting it down by holding the power button, but since it's a OS update I'm afraid the drive will be corrupted, and unfortunately I don't have a current backup of the drive either... Help

    I left my macbook plugged in over night, we're now going on 14 hours of this blue screen with the spinning wheel/symbol. Anyone?

  • Custom applet class loader, how?

    Fellow Java programmers;
    I would like to load 'secure' class files (ie encrypted) into an applet at startup time.
    I have code that does this for a normal java program.
    How do you go about using a custom class loader in an applet?
    Would something like this work? (using say *.Xclass local encrypted class files)
    ..somewhere in theapplet: init().. runClass()
    .public void runClass(name)
    { aCL = new AppletClassLoader(); // extends ClassLoader
    Class c = aCL.loadClass(name);
    Method m= c.getMethod("main"..)
    m.invoke(...);
    Your comments or pehaps a code snippet would be appreciated.
    Thanks, John

    John,
    this does not work without modifying the runtime client environment.
    Security constraints will prevent you from setting up a new class loader, so you will have to at least grant this permission in a policy file deployed to your clients as you will have to deplay the encryption keys.
    As bringing in a new class loader from an applet is highly security critical, this should be backed by a rather strict policy and by signing the applet.
    Though the example you provided might work, the class loader implementation itself is not so easy-
    If you would like to imitate the findClass() and loadClass() methods from SUN you will see that those are complex and not suitable for "hooking" in an encrypted stream.
    You might try an easier way:
    Load the class data as an encrypted byte array, decrypt it and use SUNs class loader methods to define a JAVA class out of this byte array:
    ClassLoader.defineClass(String�name, byte[]�b, int off, int�len)
    This seems to be easier than implmenting your own loader.
    Oliver

  • Is it possible to LOAD and INSTALL applet during pre-personalization?

    Hi Friends..
    Currently, i use JCOP card
    I want to know the other way to LOAD and INSTALL applet not through CardManager..
    I mean, is it possible to LOAD and INSTALL applet during pre-personalization time?.
    Thanks in advance

    Hi,
    i want to LOAD and INSTALL Applets while pre-personalization phase..
    No, i don't want to defer the LOAD and INSTALL..In the past, we have used the pre-personalisation phase to load KDC keys onto a card and remove the ISK and set issuer specific identifiers (IIN and CIN) etc. You could also load your applet at this time if you wish. You can also load the applets at personalisation.
    How do you plan on doing the personalisation phase? If you were to use a GP scripting environment for example, the CAP files are embedded as a part of the install scripts and only loaded onto a card when you begin executing your personalisation scripts. Since I assume you will be using the small desktop printers mentioned in a different thread, you may be better off integrating the applet loading into your personalisation code (printer integration) so you do not need to double handle cards.
    Actually, is it possible to LOAD and INSTALL applet if we don't authenticate to the CardManager?..There are ways to load and install an applet without explicitly calling INIT UPDATE and EXTERNAL AUTH, but you still need to be authenticated to the card manager, otherwise anyone could manage card content. You can use install tokens and delegated management (which are all outlined in the GO Card Spec).
    Cheers,
    Shane

  • A sign Applet unable to load "oracle.jdbc.OracleDriver" class

    hi,
    i am chiranjit , i am now working in a web based ERP. where i am using a signed applet which unable to load "oracle.jdbc.OracleDriver" class but it easily loading "sun.jdbc.odbc.JdbcOdbcDriver", i am also giving my code:
    import java.sql.*;
    import java.math.*;
    import java.io.*;
    import java.awt.*;
    class JdbcTest extends Applet{
    public static void main (String args[]) throws SQLException {
    // Load Oracle driver
    DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
    // Connect to the local database
    Connection conn =
    DriverManager.getConnection
    ("jdbc:oracle:thin:@192.168.16.7:1521:kris",
    "plsql", "oracle");
    // Query the employee names
    Statement stmt = conn.createStatement ();
    ResultSet rset = stmt.executeQuery ("SELECT FIRST_NAME FROM
    AUTHORS");
    // Print the name out
    while (rset.next ())
    System.out.println (rset.getString (1));
    // Close the result set, statement, and the connection
    rset.close();
    stmt.close();
    conn.close();
    }

    Hint: The sun.jdbc.odbc.JdbcOdbcDriver is available in any JRE distribution. The Oracle driver is not.

  • Netscape 's inconsistency in the loading of applets/classes

    Please I will appreciate any help.
    I am using Netscape version 4.75 on a Windows NT platform to launch my application.
    My application is a collection of java classes and applet classes and a gif file all zipped
    into an archive ( zip -o ). These classes are written in the old java version 1.0.2
    (unfortunately).The problem is that when it is launched from a netscape browser,
    sometimes all the classes get loaded but other times the loading fails. The zip file is not compressed since we realized that it was failing more often with a compressed zip file.
    SO we removed the zip file... This is how we are launching the application now but this,
    too, creates a problem because there are incidents of partial or incomplete loading of
    the classes. This application has been in use for over 3 years now, what can I do?
    Please help!
    Ike Eke

    Thanks for you quick response.
    I have not tried a jar. Can I jar these classes that were written in java 1.0.2?
    I have recommended that the application be upgraded to 1.1.x but they say there is
    no money to do that, The customer would not fund it.
    This problem does not occur on IE but we do not support IE any way. We run on HP,SUN,
    and Windows NT platforms but this problem occurs only on NT. This is a production problem
    so it occurs very where there is an NT machine ( over 200 NT users out there).
    This is the version of Netscape that was chosen by the customer and yes it occurs on other netscape versions as well. I thought that jar files came with the emergence of java 1.1.x.
    If it is possible to jar this outdated version of java classes, then I am willing to try it but
    what is required to do this?
    Thanks again
    Ike

  • [svn:bz-trunk] 23143: Certain code needs to check the existence of the class validation validator  (some brokers and other listeners) during message broker init, however the validator was not being created till the very end of the method .

    Revision: 23143
    Revision: 23143
    Author:   [email protected]
    Date:     2011-10-27 06:31:02 -0700 (Thu, 27 Oct 2011)
    Log Message:
    Certain code needs to check the existence of the class validation validator (some brokers and other listeners) during message broker init, however the validator was not being created till the very end of the method.  Promote it to be at the top instead of at the bottom.
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/config/MessagingConfiguration.java

    Revision: 23143
    Revision: 23143
    Author:   [email protected]
    Date:     2011-10-27 06:31:02 -0700 (Thu, 27 Oct 2011)
    Log Message:
    Certain code needs to check the existence of the class validation validator (some brokers and other listeners) during message broker init, however the validator was not being created till the very end of the method.  Promote it to be at the top instead of at the bottom.
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/config/MessagingConfiguration.java

  • Loading Images into Applets

    I've been having problems loading an image into an Applet. I've found that when the getImage() call is put into the init() method it loads the image fine, also implementing an imageUpdate call. However, now I'm trying to expand on this by putting it into a button click, it hangs indefinitely while waiting for the image to load.
    Another interesting point I've noticed is that the Canvas subclass ImageSegmentSelector uses a PixelGrabber in its constructor to put the Image into a buffer - when this class is created from the imageUpdate() call, NOT the init() call, the grabPixels() call hangs indefinitely too!!
    Any feedback, please,
    Jonathan Pendrous
    import java.applet.*;
    import java.net.*;
    import jmpendrous.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    public class XplaneGlobalSceneryDownloader extends Applet implements ActionListener{
    ImageSegmentSelector worldMap;
    Image img;
    URL url;
    int longtitude = 36;
    int latitude = 18;
    boolean imageLoaded;
    TextField t1, t2,t3;
    Label l1,l2,l3;
    Button b1;
    Applet a1;
    public void init() {
    a1 = this;
    l1 = (Label) add(new Label("Number of horizontal sections: "));
    t1 = (TextField) add(new TextField("45",3));
    l2 = (Label) add(new Label("Number of vertical sections: "));
    t2 = (TextField) add(new TextField("45",3));
    l3 = (Label) add(new Label("URL of image file: "));
    t3 = (TextField) add(new TextField("file:///C:/java/work/xplane_project/source/world-landuse.GIF",60));
    b1 = (Button) add(new Button("Load image"));
    b1.addActionListener(this);
    validate();
    // THIS CODE WORKS FINE ...
    /*try { url = new URL("file:///C:/java/work/xplane_project/source/world-landuse.GIF"); }
    catch(MalformedURLException e) { System.exit(0);   }
    img = getImage(url);
    //int w=img.getWidth(this);
    while(imageLoaded==false) { try { Thread.sleep(1000);   } catch(InterruptedException e) {System.exit(0);    } }
    worldMap = new ImageSegmentSelector(this, img, longtitude, latitude);
    add(worldMap);
    //resize(worldMap.getWidth(), worldMap.getHeight());
    validate();*/
    //repaint();
    //worldMap = new ImageSegmentSelector(this, img, longtitude, latitude);
    //repaint();
    public void actionPerformed(ActionEvent e) {
    try { longtitude = Integer.parseInt(t1.getText()); } catch (NumberFormatException ex) {System.exit(0); }
    try { latitude = Integer.parseInt(t2.getText()); } catch (NumberFormatException e2) {System.exit(0); }
    try { url = new URL(t3.getText()); }
    catch(MalformedURLException e3) { System.exit(0);   }
    img = getImage(url);
    //int w=img.getWidth(this);
    while(imageLoaded==false)
    { try { Thread.sleep(1000);   } //KEEPS ON LOOPING
    catch(InterruptedException e4) {System.exit(0);    } }
    worldMap = new ImageSegmentSelector(a1, img, longtitude, latitude);
    add(worldMap);
    //resize(worldMap.getWidth(), worldMap.getHeight());
    validate();
    public boolean imageUpdate(Image i, int flags, int x, int y, int w, int h){
    // THIS NEVER GETS CALLED AT ALL //
    if (((flags & ImageObserver.WIDTH) != 0) && ((flags & ImageObserver.HEIGHT) != 0)) {
    //worldMap = new ImageSegmentSelector(this, i, longtitude, latitude);
    //add(worldMap);
    //validate();
    //repaint();
    imageLoaded = true;
    return false;
    return true;
    }

    Sorry, thought this had been lost.
    You can load a file if the applet itself is run from the local filesystem - it loads it fine from the init(), but not otherwise. But I haven't got the applet to run from a browser yet without crashing (it's OK in the IDE debugger), so that's the next step.

  • I always get an error: applet not inited

    ok here's my code
    public class Payroll extends javax.swing.JApplet {
        /** Initializes the applet Payroll */
        public void init() {
            try {
                java.awt.EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        initComponents();
                        //initialize a  frame
                        f = new PFrame();
                        f.setVisible(true);    
            } catch (Exception ex) {
                ex.printStackTrace();
        /** This method is called from within the init() method to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {....} // </editor-fold>                       
        // Variables declaration - do not modify                    
        // End of variables declaration                  
        private RecordInput recordinput;
        private PFrame f;
    }basically i want my applet to create a frame during initialization, its working ok in netbeans but when i tested it in IE it always shows an error saying applet not inited.

    here's my html for testing purposes
    <html>
    <head>
    <title>Payroll App</title>
    </head>
    <body bgcolor="#000000" text="#FF00FF">
    <center>
    This a Java applet:<br>
    <object height=150 width=300
    classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    codebase="http://java.sun.com/products/plugin/autodl/j
    install-1_4_0-win.cab">
    <param name="Code"
    value="E:\Payroll\build\classes\payroll\Payroll.class
    >
    You need a Java-enabled browser to see this.
    </object>
    </html>Doesn't look correct. Google on how to create html page for an applet.
    Kaj

  • Loading dll from applet

    Hello all
    I am trying to develop an applet whose funtionality includes loading a .dll library and invoking some function implemented as native code. The dll implementation is actually third-party, but i am pretty confident there's nothing wrong with it because it works fine when invoked in a standalone application.
    Before going any further, i should note that i am aware of security restrictions, signing applets etc - i have temporarily bypassed that limitation during development by granting a java.security.AllPermission permission in my JRE policy file.
    In fact, the dll itself even works fine when invoked from the applet source directory - i.e. directory source contains the applet class file and the dll file, so when opening the applet using appletviewer and a test html page that contains something like this: <APPLET CODE='PrintApplet.class' WIDTH=426 HEIGHT=322>, everything works fine.
    Trouble starts when i try to package the applet source and the dll into a jar file and open it again using the same procedure, only this time using something like this in my html:
    <APPLET CODEBASE="C:/testdir/PrintApplet" archive="PrintApplet.jar" CODE="PrintApplet" WIDTH=426 HEIGHT=322>
    In this scenario, the dll is loaded using:
    InputStream in = this.getClass().getResourceAsStream("ShellExec.dll");
    and then saved on the client disk using a FileOutputStream.
    What happens then is that i get the following stacktrace:
    java.lang.UnsatisfiedLinkError: C:\testdir\PrintApplet\ShellExec.dll: Invalid access to memory location
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1368)
    at java.lang.Runtime.load0(Runtime.java:737)
    at java.lang.System.load(System.java:809)
    at ShellExec.<clinit>(ShellExec.java:19)
    at PrintApplet.testPrint(PrintApplet.java:200)
    at PrintApplet.clearButton_ActionPerformed(PrintApplet.java:215)
    at PrintApplet$SymAction.actionPerformed(PrintApplet.java:159)
    at java.awt.Button.processActionEvent(Button.java:381)
    at java.awt.Button.processEvent(Button.java:350)
    at java.awt.Component.dispatchEventImpl(Component.java:3639)
    at java.awt.Component.dispatchEvent(Component.java:3480)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    This seems to suggest that the dll is actually loaded, but then something gives. Any ideas as to what may be the issue here?
    Thanks in advance,
    George Anadiotis

    It's not possible to load a DLL file from a jar file. Read the Jar tutorial
    Oz.

  • "Bad Applet class name" error while recording on Oracle Forms 11g through OpenScript (JRE 1.7.0_17)

    Hi,
    I am trying to record automation functional test script on Oracle Forms 11g using OpenScript.
    Able to open the browser, but after accessing application URL, getting application error as "Bad Applet class name"
    Java Plug-in 10.17.2.02
    Using JRE version 1.7.0_17-b02 Java HotSpot(TM) Client VM
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    SSV dialog is suppressed........
    cracked oracle.forms.engine.Main
    Loading cached Forms Jars ...
    Is this version (Oracle forms 11g, JRE 1.7.0_17) supported by OATS-OpenScript ?
    Please advise if there is any work around here.
    Thanks.

    From the last OATS release notes available in the C:\OracleATS\docs directory:
    4.1 Oracle Functional Testing/OpenScript
    Oracle Functional Testing’s OpenScript scripting platform has the following system
    requirements:
    ■ Operating System (32-bit and 64-bit versions): Windows XP, Windows Vista,
    Windows 2003, Windows 7, Windows 2008, Windows 2008 R2.
    ■ Memory: Minimum 1 GB
    ■ System: x86, 32-bit or 64-bit processor, 2.6 GHz or faster
    ■ Disk Space: 4 GB minimum
    ■ Browser: Internet Explorer 7.x, 8.x., 9.x; Firefox 3.5/3.6, 6.x, 10; Chrome 27+
    (playback only).
    ■ Java Runtime Environment: JRE 1.6 minimum (up to build 38), JRE 1.7 (up to build
    11) .
    So basically, it's not supported... Can you try with another JRE version?
    As always don't forget to run OpenScript as administrator on W7/8 or equivalent
    JB

  • How to include applet in jsp if applet.class file in another folder

    hi,
    i'm getting problem when my applet.class file is not with its appropriate jsp file. i'm using jsp :plugin tag.it work when jsp file n apllet.class file at same location.
    in short my jsp file is at location /webapps/jsp-examples/myproject/includeDemo.jsp
    n applet i want in a WEB-INF folder.
    Plz help me to solve this..
    or give me other way that an applet can be loaded in jsp page n applet should be in WEB-INF file..
    Help me for this

    http://forum.java.sun.com/thread.jspa?threadID=5148764&messageID=9556205

  • Servlet cannot find applet class.. HELP..DONT REPLY..SOLUTION FOUND

    Hi.. can anybody help me.. with this age old problem?
    I have an applet.. which generates a pie chart .. Pie.class. If i embed it in a normal HTML page.. it runs smoothly.
    Now the problem is.. in my servlet i tried to do this
    out.println("<applet code=Pie.class codebase=/mywebapp/  height=300 width=300">);etc..
    but when the servlet runs.. the applet is not initalised .. so instead of having the applet i have a 'x' sign.. .. To diagnose the problem better.. i right click on the area that is supposed to be the applet and select 'Open Java Console' . ..there i see.. a ClassNotFound Exception.
    I have kept the Pie.class in the WEB-INF -> classes Folder ( where all the other class files of the servlets are kept ).
    Can anybody help me??
    Thanks in advance
    Hi guys sorry to bother u.. i have found the soln. myslef... my mistake was to place the applet class in web-inf-> class folder.. as soon as i placed it outside the folder.. it worked superbly. Thanks anyway
    Message was edited by:
    arijit_datta

    me also same problem...
    this class path is included in server itself..
    or we can set during compiling time...
    then this is my compile.bat file please check
    set classpath=%CLASSPATH%; ./WEB-INF/classes;
    @echo off
    javac -d ./WEB-INF/classes/ ./dev/beans/*.java
    javac -d ./WEB-INF/classes/ ./dev/ContentManagement/beans/*.java
    javac -d ./WEB-INF/classes/ ./dev/servlets/*.java
    and my servlet file like this below..
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.deploy.servlet.*;
    public class ControlServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              out.println("Testing");
    /*          if (request.getParameter("pageName")=="CEOSpeak")
                   CEOBean CB = new CEOBean();
                   if (request.getParameter("actionType")=="add")
                   else if (request.getParameter("actionType")=="edit")
                   else if (request.getParameter("actionType")=="delete")
                        if(CB.deleteCEO(request.getParameter("CEOId")))
                             response.sendRedirect("CEO_Speaks.jsp");

  • Netscape.javascript.JSObject outside an applet class

    Hi,
    I need to evaluate some Javascript expressions inside my java code... BUT my code is not inside an Applet class. Does anyone know how to do it?
    I chose to use the netscape.javascript package, it work well inside an applet.. but my application doesn't run inside an applet. When I try to run it inside a standalone application it fails (even if the application extends from the Applet class).
    Here is part of the code:
    public class Applet1 extends Applet {
    public void init() {
    try {
    String out;
    JSObject win = JSObject.getWindow(this);
    out=win.eval("2+3;").toString();
    jLabel1.setText(out);
    System.out.print(out);
    public static void main(String[] args){
    Applet1 app=new Applet1();
    app.init();
    The code runs perfect inside Internet explorer, but it crashes when running in standalone mode.
    Thanks.

    You can also use Rhino to execute JavaScript
    http://www.mozilla.org/rhino/

Maybe you are looking for