[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • 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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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