Applet instances

R

Roedy Green

If you have multiple instances of an Applet on page, how can they give
error messages to tell you which one is having a problem. I have
added <parameter name="instance" value="10"> with unique values to
each instance.

Is there an easier way?
 
R

Richard Maher

If you have multiple instances of an Applet on page, how can they give
error messages to tell you which one is having a problem. I have
added <parameter name="instance" value="10"> with unique values to
each instance.

Is there an easier way?

I thought there was but looking at my code (which I hope to finish over
easter) I just use static variables and an array of my <windowSlot>
class. If there's a null entry use that else .add() it on the ArrayList etc.

I'll check again next w/e 'cos iirc the Applet thread gets a unique
index for each instance so I'm guessing there's some intrinsic attribute
somewhere.
 
R

Roedy Green

I'll check again next w/e 'cos iirc the Applet thread gets a unique
index for each instance so I'm guessing there's some intrinsic attribute
somewhere.

with the old APPLET tag there was name=. I think it has disappeared in
HTML5 OBJECT. Logically ID= should work, but I don't think there is a
method to read it.

In my case, I generate the OBJECT tags with a macro generator, so it
is no problem to add a sequence number on page parameter to uniquely
identify applets.

<param name="instance" value="12">

I suspect that using static for communication will have the same
problem. If the browser starts putting your Applets in different
JVMs, they will each get their own static area.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top