Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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

Generating HTML page from Applet

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an Applet program that takes user input and display information on the Applet window. Is it possible to generate HTML page from within the applet to show the applet output in a web page separate from the Applet window?
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Not directly. There are a few options for achieving something similar, though.
  • The applet can manipulate the DOM of the HTML it's embedded in (and possibly other frame son that page) through the Common DOM API. A link to that can be found in the Applet FAQ.
  • The applet could write an HTML file to the local hard disk, and have the browser open that file. It would need to be signed to do that (links about which can again be found in the Applet FAQ).
  • The applet could post the pertinent information to a server-side component (e.g. a servlet), and could then ask to the browser to display a new page off the server that incorporates that information.

  • Do any of these sound like they might do what you're looking for?
     
    Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
      Bookmark Topic Watch Topic
    • New Topic