aspose file tools*
The moose likes Applets and the fly likes How do I load search results into my applet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "How do I load search results into my applet?" Watch "How do I load search results into my applet?" New topic
Author

How do I load search results into my applet?

Billy Sclater
Ranch Hand

Joined: Nov 18, 2012
Posts: 131

My goal is to have an applet that #1 searches Yahoo, and then #2 displays the search results in the applet itself.

I am playing with 2 classes from this site: http://www.apl.jhu.edu/~hall/java/CGI-with-Java.html
SearchService.java and SearchYahoo.java.

#1 is taken care of, what it does is displays a textfield,
on entering my search into the textfield and clicking the button, the applet goes directly to Yahoo.com
and displays the search results.

Does anyone know a way to display the results in the directly into the applet itself in a small window?


Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10255
    
    8

One possible way to do it would be have a JEditorPane embedded in your applet which you load with the yahoo query page.
Another would be to explore if yahoo exposes a search API which returns JSON or XML or any other format which your applet can consume. Then parse the data and display in whatever way you wish. Of course you will have to overcome the sandbox restriction, because "an applet can only dial home"


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Billy Sclater
Ranch Hand

Joined: Nov 18, 2012
Posts: 131

The JEditorPane solution sounds like the easiest way.
But, I'd like to be able to display 'clickable' links in the applet. I suppose I could also use openStream() and parse the data to retrieve 4 or 5 links. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I load search results into my applet?