Re: Applet and parent browser



On Jan 18, 6:52 pm, Arne Vajhøj <a...@xxxxxxxxxx> wrote:
On 1/18/2012 6:05 PM, simplicity wrote:

Is it possible to get the reference to browser window which contains
the applet?

I tried Window win = (Window)this.getParent() but I do not know what
it really returns.

I tried to verify what the above might be by looking at win.getName().
I am getting "frame0" while the browser window name is
"<document.title>  - Windows Internet Explorer".

Try:

JSObject window = JSObject.getWindow(this);

to get out in the browser and window.gtMember("title") for actually
getting the title.

Untested!

Arne

Did not work. According to the documentation JSObject.getMember
returns equivalent to javascript this.name. I tried it and it yields
null.

However, the title is not what I need. As I mentioned in the original
email, I need my applet to obtain the reference to the parent window
(the browser). I need it to feed the specific API which will register
the application with the hardware and allow me to pass the hardware
events to the applet. This API takes the top level window as a
parameter

It is easy for a standalone application - just pass JFrame to API. I
need the equivalent of this when the application runs inside the
browser.
.



Relevant Pages

  • Re: browser screen capture with java applet
    ... the applet would be to do the job of the actual image capturing on each ... current browser window - if that's relevant. ... minimum Java version. ...
    (comp.lang.java.programmer)
  • Dynamically pre-size an applet to percentage of window width?
    ... a Java applet window in the calling HTML. ... So the document.write statement produces a normal looking applet string ... Which gets intepreted by the browser, ...
    (comp.lang.java)
  • Re: javascript to Applet call, Browser refresh issue
    ... What browser? ... > applet.Here javascript call to Applet, ... (here the window appears closes.) ...
    (comp.lang.java.gui)
  • Re: dimensions of components...
    ... in browser, not in its own window (so now it's a JApplet, not a JFrame..) I'm assuming this means that setResizeWeightmethod doesn't apply anymore (it's embedded in browser in an applet that's 650x450.. ... that I don't think users would resize browser window to make it so small ...
    (comp.lang.java.gui)
  • comp.lang.javascript FAQ - Quick Answers 2008-10-13
    ... Javascript Tips ... _How can I disable the back button in a web browser_? ... _How do I check to see if a child window is open, ... upon the cache headers that your server sends. ...
    (comp.lang.javascript)