Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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: 25467
180
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.
 
Could you hold this kitten for a sec? I need to adjust this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic