The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
August 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


RE: Previewing two pages at a time

Posted by Kishori Sharan on August 20, 2000 at 12:38 PM

Hi Khurram
I think you want to view your applet on the left side of web page at the same time you want to open another html page on the right using your program in applet. I am not going to give you any ready made code. However, I am going to give you enough clue so that you can get it work. Follow the following steps.
1. Create a html page with two frames. Name your frames like leftframe and rightframe.
2. Create an applet and embed it in an HTML file named left.html and make this file as target for the leftframe created in STEP1. You can make target for rightframe blank or some a small html file with some welcome message.
3. In the program ( of course in applet ) when you have your c drive file name then to open it in right frame you can write the following lines of code. This code goes in applet.
AppletContext context = getAppletContext ( );
// Create a new URL object for your c drive html file
URL url = new URL ( "your c drive file " ) ;
// Open the C drive file in right frame
context.showDocument ( url, "rightframe" ) ;
That's it.



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us