2

How to call javascript alert from java class

chetan
  • 3,175
  • 20
  • 72
  • 113
  • I think you need to understand what [Greg Hewgill wrote](http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java/245068#245068) to the question [What’s the difference between JavaScript and Java?](http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java): *Java and Javascript are similar like Car and Carpet are similar.* – aioobe Oct 21 '10 at 10:31
  • Your question cannot be intelligently answered in its current form. As Wazzy said, *please elaborate*. See also: http://stackoverflow.com/questions/ask-advice – T.J. Crowder Oct 21 '10 at 10:32
  • The complete lack of context here means that any answer could only ever be speculative. Voting to close. – spender Oct 21 '10 at 10:32

2 Answers2

1

I can't know for sure, but if you want to make a Java Applet and Javascript interact, try these:

Java-to-Javascript Communication

Java - Javascript interaction

mdrg
  • 3,242
  • 2
  • 22
  • 44
0

Perhaps you are looking for a message box similar to the Javascript alert() box? Then use

javax.swing.JOptionPane.showMessageDialog(null, "hello");
Bevin
  • 952
  • 6
  • 19
  • 35