module JavaApplet: sig .. end
Support for Java applets.
In order to produce a jar archive containing an applet, it is
necessary to link the application with the -applet k command-line
switch, where k designate the kind of applet (AWT-, Swing-, or
Graphics-based). An applet class will be generated, with name
pack.ocamljavaApplet where pack can be set using the
-java-package p command-line switch.
When linking with the -applet k command-line switch, the last
module to be linked has to abide to one of the module types of the
JavaApplet
module, the exact module type depending on the value of
k.
type parameter = {
|
param_name : java'lang'String java_instance; |
|
param_type : java'lang'String java_instance; |
|
param_desc : java'lang'String java_instance; |
}
The type of parameters, describing parameters accepted by an applet.
type parameter_info
The type of parameter info, as returned by the getParameterInfo()
method.
val parameter_info_of_list : parameter list -> parameter_info
Converts a list of parameters into a parameter info, preserving the
order of elements.
AWT-based applets
type awt = java'applet'Applet java_instance
Shorthand for the type of AWT applets.
module type AWT = sig .. end
The module type for applets linked with -applet awt.
Swing-based applets
type swing = javax'swing'JApplet java_instance
Shorthand for the type of Swing applets.
module type Swing = sig .. end
The module type for applets linked with -applet swing.
Graphics-based applets
type graphics_event = {
|
mouse_x : int; |
|
mouse_y : int; |
|
button : bool; |
|
keypressed : bool; |
|
key : char; |
}
Equivalent to Graphics.status
, copied to avoid dependency.
module type Graphics = sig .. end
The module type for applets linked with -applet graphics.