Page 1 of 1

Code sharing between applets

Posted: Tue Feb 23, 2016 3:52 am
by ordane
I am looking for ways on how to share custom libraries between applets. Does anyone know how to write source code in order to include common custom classes in different applets? Thanks for any answer!
Note: I am not looking for interface sharing between applets.

Re: Code sharing between applets

Posted: Thu Feb 25, 2016 11:47 pm
by mabel
Let me give you a clear thinking:

- Create new Class, but don't extend Applet, let it called Library Class.
- Generate jar, exp and cap of this library class.

Case example:
- You can have 2 applet, for example Applet A & B.
- Applet A can use the API (common code/method) from the Library Class by importing the jar file of Library Class.
- Generate cap file of Applet A by including exp file of the Library Class.
- Applet B can use the API (common code/method) from the Library Class by importing the jar file of Library Class.
- Generate cap file of Applet B by including exp file of Library Class.

By doing this scheme, the Library Class shall be loaded first before you load and install Applet A & B.