Communication between Java applets has been an interesting topic from the early days of Java.之间的沟通, Java applets的已一个有趣的话题,从成立之初的Java 。 There are several esoteric ways to communicate like using Javascript as a bridge.有几个深奥的通信方式一样,使用JavaScript作为一个桥梁。 However we will look into the simplest and most reliable method of intra-applet communication.不过,我们会考虑最简单和最可靠的方法内部Applet的沟通。

Simple solution to applet communication problem 简单的解决办法Applet的沟通问题
Use a class with static getters and setters method(s) to pass data around.使用一类与静态getters和制定方法( )通过数据左右。 Since the applets are loaded in the same JVM, the static methods can be used to share any kind of data between the applets.由于程序加载在同一个JVM的,静态方法可以用来分享任何种类的数据之间的程序。

Another more complex solution is to use the database to communicate data between the applets.另一种更复杂的解决方案是使用数据库进行数据通信之间的程序。 This may be useful if the applets are on different machines or different JVM’s as in two application server / tomcat instances.这可能是有用的,如果程序是在不同的机器或不同的JVM的作为在两个应用服务器/ Tomcat实例。