Solved

Display a created HTML file

Posted on 1998-07-22
11
220 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

776 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