Solved

Display a created HTML file

Posted on 1998-07-22
11
234 Views
Last Modified: 2011-09-20
I want to display a HTML file that is generated on fly by my applet. ie
like an offscreen image I want to display a html file in the browser's frame on my multi frame html page.
Please help me.
regards
agvkumar
0
Comment
Question by:agvkumar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 6

Expert Comment

by:gadio
ID: 1227596
There are several products that display html. There is a swing component that does that, and there is a compleate browser component in java that you can use from sun. Go to their site and download the evaluation version.
0
 
LVL 6

Expert Comment

by:gadio
ID: 1227597
You can download the browser from sun at:
http://www.javasoft.com/products/hotjava/bean/index.html

0
 
LVL 6

Expert Comment

by:gadio
ID: 1227598
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:agvkumar
ID: 1227599
hi,
  all the above answers are for applcations or simple html. I have a VRML code in my page
that is generated. I want to use the browser's VRML capapbilities. Hence These third party tools (though great are of no use and I do not want to develop any VRML rendering stuff) are of no use. Please help me regarding this


0
 
LVL 6

Expert Comment

by:gadio
ID: 1227600
How about www.tgs.com ?
0
 

Author Comment

by:agvkumar
ID: 1227601
it is a very expensive method I want to use the browsers plugin

0
 
LVL 6

Expert Comment

by:gadio
ID: 1227602
It seems that my answer is not good for you. You can reject it. You might want to edit your question and specify about the VRML.
Good luck,
G.
0
 
LVL 4

Expert Comment

by:evijay
ID: 1227603
use live connect and javascript

in java, invoke a javascript method which inturn writes the data on to the desired frame

This seems to be the only plausible method for displaying a dynamically generated html page onto a frame in browser since javascript has full control over the browser.

see developer.netscape.com for more info on connecting java and javascript.

0
 
LVL 4

Expert Comment

by:evijay
ID: 1227604
if you want source, i can give it tomorrow


vijay

0
 

Author Comment

by:agvkumar
ID: 1227605
dear Vijay,

 This is what I was looking for please help me.
  Please help me with the source and please point me to an URL where I can get the
javascript packages and help to be used in java.

Thanking you
venkatesh

0
 

Accepted Solution

by:
krishnakumar earned 300 total points
ID: 1227606
Hi Venkatesh,
Try the following code. The design is to give the HTML content to javascript. Then Javascript will write the content to a newly opened window. Tell me if you need more details.

-Krishnakumar

JAVA CODE:
---------
public class jtest extends Applet
{
      boolean m_bReady = false;
      String m_str = null;
      public boolean IsDocReady()
      {
            boolean bReady = m_bReady;
            m_bReady = false;
            return bReady;
      }
      public String GetData()
      {
            return m_str;
      }
      public boolean mouseDown(Event evt, int x, int y)
      {
            m_str=new String("<html>\n<head>\n<title>jtest</title>\n</head>\n<body>\n<hr>\n<hr>\n<a href=\"jtest.java\">The source.</a>\n</body>\n</html>\n");
            m_bReady = true;
            return true;
      }
}
---------------

HTML source (with javascript):
<html>
<script language=javascript>
<!--
function Timer()
{
  if(self.document.myapplet != null)
  {
    if(self.document.myapplet.IsDocReady() == true)
    {
      var str = self.document.myapplet.GetData();
      if(str != null)
      {
        var NewWindow = window.open('',"NewWindow", "toolbar=yes,location=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes");
        NewWindow.document.write(str);
      }
    }
  }
  setTimeout("Timer();",2000);
}

setTimeout("Timer();",2000);
//-->
</script>
<body>
<applet
    code=jtest.class
      name="myapplet"
    id=jtest
    width=320
    height=240 >
</applet>
</body>
</html>

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to execute a Python program and gather return output in Java 2 49
jsp login check 12 53
collection output issue 9 65
Java array sort 10 34
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question