• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Open JDialog from Javascript?

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the HTML and JavaScript forum.
reply
    Bookmark Topic Watch Topic
  • New Topic