File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Open JDialog from Javascript? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Open JDialog from Javascript?" Watch "Open JDialog from Javascript?" New topic
Author

Open JDialog from Javascript?

Herbert Kornfeld
Ranch Hand

Joined: Apr 16, 2003
Posts: 32
Hi,
What I am trying to do is open a JDialog from javascript in an html page. I have found code to do this and I am 90% there in that I can bring up the dialog from a javascript function - the problem is that when the dialog is visible there is an hourglass and you can't edit anything within the dialog - and then the browser just becomes hung.
So, my code is thus - I have a hidden applet in the html page:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.border.*;
import java.util.*;
public class HiddenApplet extends JApplet
{
public HiddenApplet()
{ }
public void openAddKeyword()
{
System.out.println("called in method");
AddKeywordsDialog d = new AddKeywordsDialog();
d.center(d);
d.show();
d.setVisible(true);
System.out.println("called in method out");
}
}
Then in my html page I have:
function call_java() {
document.hiddenapplet.openAddKeyword();

}
and:
applet
applet code="HiddenApplet" width = 10 height = 10
name = "hiddenapplet" applet
and then I call the calljava method from a submit button

(please use your imagination - I had to take out the arrow characters so I could post)
Many Thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12511

Moving this to the HTML and JavaScript forum.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
 
IntelliJ Java IDE
 
subject: Open JDialog from Javascript?
 
Threads others viewed
Problem while Invoking Applet's method from javascript
Problem while Invoking Applet's method from javascript
Applet and XML Doc through a browser
showModelessWindow() in IE restricts javascript to applet communication
"Java Applet Window" warning shows with signed applet when called from JavaScript
developer file tools