Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AppletContext.showDocument()

 
Baiju Scariah
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Baiju Scariah
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
" 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
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And your HTML frameset declares a frame with that name?
 
Baiju Scariah
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic