Solved

Java Applet - returning information

Posted on 2004-09-11
5
185 Views
Last Modified: 2010-03-31
Hi,
   Is it possible ( or easy ) to pass values back from an Applet into the HTML page it was called from? A friend is writing a colour picker which works really well... only he isn't sure how to make that available in the html page or if its even possible.... I don't know either so I thought I'd ask the gurus :)

thanks in advance!
0
Comment
Question by:petepalmer
  • 3
  • 2
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 12034357
Yes. You can call the applet from JavaScript and vice versa.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 125 total points
ID: 12034366
Although it's easier to call public methods of the applet from JavaScript using a reference:

var applet = document.applets[0];
var x = applet.foo();

you can also do it the other way around:

http://www.rgagnon.com/javadetails/java-0172.html
http://www.apl.jhu.edu/~hall/java/JavaScript-from-Java.html
0
 
LVL 1

Author Comment

by:petepalmer
ID: 12034421
That's what I've been trying.... I'll go double check my code :)

hold the answers for now please :)
0
 
LVL 1

Author Comment

by:petepalmer
ID: 12034447
I had it right but the string I was trying to return was wrong....grrr...

oh well at least I knew I was on the right track after all. thanks CEHJ!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12034452
8-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 21
allswap challenge 6 76
egit plugin on eclipse 8 31
even odd program using while loop 3 25
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now