• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

jobjects with javaweb

hi
  i'm trying to use jsobjects with javaweb..and get this error below

etscape.javascript.JSException
      at netscape.javascript.JSObject.getWindow(Unknown Source)
      at CRMAddNewCalendarItem$1.actionPerformed(CRMAddNewCalendarItem.java:214)
      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 )   {
                   
                try{
                   
                   if  (lStartDueField.length() == 0)
                   {
                     JSObject win = (JSObject) JSObject.getWindow(applet);
                       win.eval("alert (\"" + "sd" + "\");");
                   }    
                    populateCalendar(conn);  
                }
                   catch( SQLException ie ) { System.out.println( ie ); }
                 
                }
   });


anyone know what i'm doing wrong
0
trance12
Asked:
trance12
  • 3
  • 2
1 Solution
 
objectsCommented:
Javascript only works in a browser, you cannot use it with jws
0
 
trance12Author Commented:
thanks..whats the alternative..??

maybe i should just design an applet to be called for javascript alerts?
0
 
objectsCommented:
If you're using jws then you should be writing applications, and not applets.
If you want to popup an alert then use JOptionPane
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html#features
0
 
trance12Author Commented:
thats exactly what i wanted..optionpane..thanks heaps..:)
0
 
objectsCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now