Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Getting Two Java Applets to Communicate with Each Other

Reply
Thread Tools

Getting Two Java Applets to Communicate with Each Other

 
 
kvnsmnsn@hotmail.com
Guest
Posts: n/a
 
      08-30-2005
Is there a way in Java to write two applets in which one user using
one applet can send messages to be read by another user using the
other applet, at a potentially distant location?

---Kevin Simonson

"You'll never get to heaven, or even to LA,
if you don't believe there's a way."
from _Why Not_

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      08-31-2005
On 30 Aug 2005 14:38:54 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote or quoted :

>Is there a way in Java to write two applets in which one user using
>one applet can send messages to be read by another user using the
>other applet, at a potentially distant location?


Yes. Once you have the AppletContext you can call methods of the
other applets.

See http://mindprod.com/products1.html#CURRCON source code for an
example of how I do it. In CurrCon, if any Applets discovers the user
would like to use a different currency, it informs all the other
Applets who update their displays.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      08-31-2005
On Wed, 31 Aug 2005 00:45:35 GMT, Roedy Green wrote:

> On 30 Aug 2005 14:38:54 -0700, (E-Mail Removed) wrote or quoted :
>
>>Is there a way in Java to write two applets in which one user using
>>one applet can send messages to be read by another user using the
>>other applet, at a potentially distant location?

>
> Yes. Once you have the AppletContext


...I do not understand how the AppletContext can be used here.
The context is not guaranteed to be the same in different frames
of a web page, let alone for another applet at 'a potentially
distant location'.

To the OP, could you tell us. Do you mean communicate between
applets on different PC's?

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"If no one out there understands, start your own revolution and cut out the
middle man."
Billy Bragg 'Waiting For The Great Leap Forward'
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      08-31-2005
On Wed, 31 Aug 2005 01:50:25 GMT, Andrew Thompson
<(E-Mail Removed)> wrote or quoted :

>..I do not understand how the AppletContext can be used here.
>The context is not guaranteed to be the same in different frames
>of a web page, let alone for another applet at 'a potentially
>distant location'.


Sorry, the communication I described is between Applets at potentially
distant locations on the same page. There are other techniques for
Applet communication on different pages. See
http://mindprod.com/jgloss/persistence.html

If the Applets are running in different machines, they will have to
set up sockets or send datagrams to each other, or communicate via a
server. For direct Applet to Applet communication you will need to
sign the Applets.

There are many possibilities for communication:

see http://mindprod.com/jgloss/remotefileaccess.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
Joan
Guest
Posts: n/a
 
      08-31-2005

"Andrew Thompson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Wed, 31 Aug 2005 00:45:35 GMT, Roedy Green wrote:
>
>> On 30 Aug 2005 14:38:54 -0700, (E-Mail Removed) wrote or
>> quoted :
>>
>>>Is there a way in Java to write two applets in which one user
>>>using
>>>one applet can send messages to be read by another user using
>>>the
>>>other applet, at a potentially distant location?

>>
>> Yes. Once you have the AppletContext

>
> ..I do not understand how the AppletContext can be used here.
> The context is not guaranteed to be the same in different
> frames
> of a web page, let alone for another applet at 'a potentially
> distant location'.


I want to communicate with the applet in my left shoe that
monitors
all motion and activates the blinking lights.

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      08-31-2005
On Wed, 31 Aug 2005 03:24:49 GMT, Roedy Green wrote:

> Sorry, the communication I described is between Applets at potentially
> distant locations on the same page. There are other techniques for
> Applet communication on different pages. ..


Yep. That's what I think the OP meant (I also thought
you'd have a couple of suitable pages, but did not have
time to check)..

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"The storm broke with a violent flash of lightning, and an apalling crash
of thunder.."
Severed Heads 'Dead Eyes Opened'
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      08-31-2005
On Tue, 30 Aug 2005 23:22:53 -0500, "Joan" <(E-Mail Removed)> wrote
or quoted :

>I want to communicate with the applet in my left shoe that
>monitors
>all motion and activates the blinking lights.


Depending on where the blinking lights are, one of the three answers
should help you.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
John Currier
Guest
Posts: n/a
 
      09-04-2005
(E-Mail Removed) wrote:
> Is there a way in Java to write two applets in which one user using
> one applet can send messages to be read by another user using the
> other applet, at a potentially distant location?
>
> ---Kevin Simonson
>
> "You'll never get to heaven, or even to LA,
> if you don't believe there's a way."
> from _Why Not_


The only approach that I've tried that worked reliably on the various
browsers was to talk though sockets.

John
http://schemaspy.sourceforge.net

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
join to this group to have communicate with other Microsoft engineers mcp farahani MCSA 0 11-15-2009 06:59 AM
Array#each - getting each element and the index Pat Maddox Ruby 6 01-20-2006 04:04 PM
wireless client cannot communicate each other? Joe Cisco 2 11-04-2005 05:43 PM
does JS communicate with other non-browser programs? bscofield Javascript 1 02-09-2004 12:17 PM
Java applets and access to other "clients"! Rune Andresen Java 2 08-24-2003 09:00 PM



Advertisments