Emmanuel said:
yes, more or less
well, i think there's to be somewhere an address where the applet find the
classe frame for example. So if we do a child myFrame of frame, and we
change the address of frame by the address of myFrame, the applet will use
the function of myFrame instead the ones of frame i suppose. I mean, this
could be one possibility, but since i don't know where to find this
address... I don't want to change the platform library, just add some
classes on it.
You *need* to become intimately familiar with Java class loading and
ClassLoaders, the mechanism by which Java's dynamic linking behavior
operates. You would benefit from studying the details of the class file
format. I think that you will find that you cannot do what you describe
without an enormous amount of work, and that you may not be able to do
it at all. Specifically:
You _could_ define a custom ClassLoader for your application that would
load a class of your choice instead of the platform library's
javax.swing.JFrame (for instance). However, if that class' FQ name is
anything other than javax.swing.JFrame then the VM will throw an Error.
If that class' name _is_ javax.swing.JFrame then it must be a complete
reimplementation of JFrame (i.e. it cannot extend the system's JFrame
because there is a name collision). You cannot use Sun's code for this
without violating your Java license, but you must be certain to be 100%
accurate in fulfilling the published JFrame contract or some applets
will break. (In fact, any applet that depends on serializing /
deserializing a JFrame is likely to break no matter what you do.) In
addition, if you did do this then you would then be locked into
_maintaining_ your versions of these classes.
To simplify, say that we have developped a full screen browser in java,
where new windows are oppened in some panels, and we can navigate through
those panels by clicking some buttons. The problem is when we open a page
with an applet making a call to Window or one of its child (generally
JFrame), the whole idea of this browser is lost cause the applet will open
an OS-depedent window...
I hope you see what i mean. If you have any idea, it would really help.
I am not a GUI expert, but my inclination is to say that you're going
about this in the wrong way. It seems to me that a better way to
accomplish your aim might be for your application to use a custom AWT
Toolkit instead of trying to modify or substitute System classes. The
details of how that would work (including how you would specify the
appropriate Toolkit class to the system) are beyond what I'm prepared to
research at this time. The AWT and Swing classes are designed to be
customizable for a wide range of environments; it would be better to
make use of that to modify their behavior, rather than to try to replace
them.
John Bollinger
(e-mail address removed)