aspose file tools*
The moose likes Applets and the fly likes how to get an applet value in json as output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "how to get an applet value in json as output" Watch "how to get an applet value in json as output" New topic
Author

how to get an applet value in json as output

Sabarish Venkat
Ranch Hand

Joined: Jan 18, 2012
Posts: 136

I have an applet code that displays my name in the applet browser. Now am trying to get my name as json output inside the same applet. Below is my code,



When i excute am getting my name in browser but there is no response from json and am not sure how to get it. Could anyone suggest an idea to solve this.
Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
    
    1
Hi,

If I understant correctly the api JSONObject this code has to do the trick



Best regards,
Sabarish Venkat
Ranch Hand

Joined: Jan 18, 2012
Posts: 136

Thanks for your support carles, The idea you gave is not working for me. Am getting the same as before. Any other suggestions?
Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
    
    1
Hi,

I have tested this code
and the output is object correctly encoded in json
{"name":"Sabarish Venkat"}

Have I misunderstood your goal?
Sabarish Venkat
Ranch Hand

Joined: Jan 18, 2012
Posts: 136

That works when outside the applet but my goal is inside the applet i need to get the json
Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
    
    1
Hi,
Why didn't work inside the applet?
Sabarish Venkat
Ranch Hand

Joined: Jan 18, 2012
Posts: 136

No idea about that.. still debugging it...If you have any other idea let me know thanks for your support carles
Sabarish Venkat
Ranch Hand

Joined: Jan 18, 2012
Posts: 136

I got the solution, All i did is just put the code out of the paint method like below,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get an applet value in json as output