Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How do I load search results into my applet?

 
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • 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: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic