Y
Y
Ytsu Ytsuevich2015-02-08 15:59:57
Java
Ytsu Ytsuevich, 2015-02-08 15:59:57

How to get data from an applet in Java?

There is a Java applet.
It outputs a line.
Question: how to get this string in html or what script to write in JavaScript
baadfa1c634e4b7181572af28d8664e2.PNG
Inspector in Mozila browser Because
I output to the applet via g.DrawString , I think that this is impossible.
Then how else to pass data from Java to HTML ?
I just started to deal with applets, so don't throw stones at once.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
one pavel, 2015-02-08
@kofon

I didn’t work much with applets, but the first request to Google gave me an article on how to do it
www.devx.com/tips/Tip/29394

Y
Ytsu Ytsuevich, 2015-02-09
@kofon

I don’t know how you fortanulo found the first link, but thanks!
For those who are interested:
So, how to pull data from an applet:
select an element in JS and call a public method on it.

public String getStr() {
   return "some text from applet";
}

var apt = document.applets[0];  // берём элемент апплета
alert(apt.getStr());           // опаля

thank you pavel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question