Solved

Display a created HTML file

Posted on 1998-07-22
11
200 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
  • 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
 

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now