Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

send data to swing from javascript

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

First of all i calling javascript function callJS() from swing

Here is my swing code


Here is my index.jsp



myapplet in above code is my applet name

Here is my Ajax.jsp



I am getting data from this jsp to javascript is work fine,But i want to send this data to to my swing,

But unable send the data using above code,

Help me,

Thanks in advace
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi joney

can you please tell me inadvace how to call java script from swing class.Th e code you provided was not understand by me.in which place i have to insert that code and where i have to place jsp
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

But unable send the data using above code


What does this mean? Does the output of ajax.jsp properly get into "LookUp.responseText"? Does the "data" array get filled with the correct data? Then what happens when you call the create method of the applet - any JS error messages, any Java error messages or exceptions?
 
kalpana kp
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
Thanks for reply i am using swing only ,not an applet. which place i have to insert that code? i inserted in main method giving error illegal start of type expression near public void create() method
 
Ulf Dittmer
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kalvana, please note that my reply was to the original post -which I am quoting- not to your reply.

If you have a question that is different from the original one, feel free to start a new thread. The original question was specifically about applets, so I think your situation is quite different, because an application does not use JavaScript or the XmlHttpRequest object.
 
I found a beautiful pie. And a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic