?
Solved

Java Applet - returning information

Posted on 2004-09-11
5
Medium Priority
?
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
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:
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

752 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