This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Java Applet Window" warning shows with signed applet when called from JavaScript

 
Kevin Draper
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a signed applet that we are using on an HTML page. The applet has lots of popup-windows that, because the applet is signed, do not show the "Java Applet Window" warning at the bottom of the page - so far so good.

However, if the user switches away from the current window, we want to save some values from the applet. To do this, we have the following



This calls into the applet and causes a dialog window to be displayed asking the user if they want to save their settings. But, when this window is displayed, the dreaded "Java Applet Window" warning is displayed at the bottom of the window.

Can some one explain to me how this is happening with a signed applet? I have verified this behaviour with both IE 6.0 and Firefox 1.0.

Thank you

Kevin.
 
David Morgan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, I know this is really really old, but I'm seeing the same problem.

I'm running a signed applet, and only the frames launched from JavaScript show the warning banner (icon now in 1.6)

Anyone have any info on this? I haven't been able to find out much about it.

Regards,
David Morgan
 
Kc Wong
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Morgan wrote:So, I know this is really really old, but I'm seeing the same problem.

I'm running a signed applet, and only the frames launched from JavaScript show the warning banner (icon now in 1.6)

Anyone have any info on this? I haven't been able to find out much about it.


Hmm... I know this is really really really really old, but I have a workaround now. Ugly, yes, but it got rid of the icon.

Same scenario with the above two posters: signed applet that creates a new dialog/frame when invoked by JavaScript.

I created a JDialog first, then called its setVisible() in these locations and FAILED:

1. AccessController.doPrivileged() - checkPermission(new AWTPermission("showWindowWithoutWarningBanner")) didn't even throw exception. Yet I got the icon.

2. AccessControlContext - I saved the instance from applet with AccessController.getContext(), and use it during doPrivileged(). checkPermission still okay and still got icon.

3. SwingUtilities.invokeLater() - Thinking the information may be carried by the current thread, I tried using another thread. Icon again.

4. Background thread - I created a background thread, and the function invoked by JavaScript sent a signal. Still had icon.


At this point I thought it had something to do with when the JDialog was constructed. So for 3. and 4. I moved the JDialog construction code inside - and the background thread method worked. Looks like SwingUtilities carried over the "insecure context" information as well.

So in summary:
1. Create a background thread in applet.
2. JavaScript invokes a method in applet that sends a signal to background thread.
3. Background thread receives the signal, creates the dialog and displays it.
4. Background thread passes the created dialog back to caller, so you can access the created dialog's methods and properties.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic