Solved

Display a created HTML file

Posted on 1998-07-22
11
239 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
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:

705 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