jobjects with javaweb

Posted on 2005-05-15
Last Modified: 2010-03-31
  i'm trying to use jsobjects with javaweb..and get this error below

      at netscape.javascript.JSObject.getWindow(Unknown Source)
      at CRMAddNewCalendarItem$1.actionPerformed(
      at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
      at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
      at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
      at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
      at java.awt.Component.processMouseEvent(Unknown Source)
      at java.awt.Component.processEvent(Unknown Source)
      at java.awt.Container.processEvent(Unknown Source)

this is the code i'm using

   addItem.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e )   {
                   if  (lStartDueField.length() == 0)
                     JSObject win = (JSObject) JSObject.getWindow(applet);
                       win.eval("alert (\"" + "sd" + "\");");
                   catch( SQLException ie ) { System.out.println( ie ); }

anyone know what i'm doing wrong
Question by:trance12
    LVL 92

    Expert Comment

    Javascript only works in a browser, you cannot use it with jws

    Author Comment

    thanks..whats the alternative..??

    maybe i should just design an applet to be called for javascript alerts?
    LVL 92

    Accepted Solution

    If you're using jws then you should be writing applications, and not applets.
    If you want to popup an alert then use JOptionPane

    Author Comment

    thats exactly what i wanted..optionpane..thanks heaps..:)
    LVL 92

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now