• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I load search results into my applet?

 
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?


 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"
 
Billy Sclater
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic