This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Applets and the fly likes AppletContext.showDocument() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Applets
Bookmark "AppletContext.showDocument()" Watch "AppletContext.showDocument()" New topic
Author

AppletContext.showDocument()

Baiju Scariah
Ranch Hand

Joined: Mar 17, 2005
Posts: 33
Problem:

AppletContext.showDocument(url, "name") pops up new windows every click on help menu item in the Frame.

url = webhelp/context.htm?contextname="context"&topic="topic"

Explanaton:

I have one applet which has a JTree. click on every node pops up a new Frame. Every frame has a Help menu item.

Click on help menuitem calls AppletContext.showDocument()to show a Help page in a new window.

AppletContext.showDocument(url, "name") is the syntax.

If I click on the help menu item of the same GUI or a different GUI it pops up a different window with help

How can I have only a single window for the help rather than every time new windows
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8914
    
    8

The Java Documentation knows all:

void showDocument(URL url, String target)

Requests that the browser or applet viewer show the Web page indicated by the url argument. The target argument indicates in which HTML frame the document is to be displayed. The target argument is interpreted as follows:
"_self" = Show in the window and frame that contain the applet.
"_parent" = Show in the applet's parent frame. If the applet's frame has no parent frame, acts the same as "_self".
"_top" Show in the top-level frame of the applet's window. If the applet's frame is the top-level frame, acts the same as "_self".
"_blank" = Show in a new, unnamed top-level window.
name = Show in the frame or window named name. If a target named name does not already exist, a new top-level window with the specified name is created, and the document is shown there.

java.applet.AppletContext
The name argument you are passing does not match an existing frame, so it creates a new top-level window.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Baiju Scariah
Ranch Hand

Joined: Mar 17, 2005
Posts: 33
" The name argument you are passing does not match an existing frame, so it creates a new top-level window. "

But I am giving the same name every time
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8914
    
    8

And your HTML frameset declares a frame with that name?
Baiju Scariah
Ranch Hand

Joined: Mar 17, 2005
Posts: 33
I couldn't get your question. Could you please exaplin that frameset?..

Since this call is aprt of a very big application I don't have any control over the applet frameset.

I am getting the AppletContext and calling the showDocument() function with url and "NewFrame" string
 
GeeCON Prague 2014
 
subject: AppletContext.showDocument()