| Andreas Rozek |
|
Applet_06An applet's display is not restricted to a fixed area within the enclosing web document - the applet may additionally open any number of windows which will pop up outside the window of the web browser. For security reasons, however, these windows are marked as belonging to an applet in order to warn the user that it might be unsafe to enter sensible information into such a window. "Applet_06" demonstrates this feature by opening an external window with a display which reflects the internal state of the applet. (Please note that some browsers seem to "unload" applets as soon as the corresponding web page is no longer the topmost one in its browser window. With such a browser, the external display will always show the same state only - in that case, just download the source code (and any additional image files), compile it locally and run the applet using Sun's "appletviewer"). Please, also consider my "Hints for Reading" and the "List of Recent Changes"!
External Frames and DialogsPrincipally, there is no difference between applets and stand-alone applications regarding the creation of external frames and dialogs: Frame externalFrame = new Frame(); externalFrame.setVisible(true); Any additional "decoration" (because of the window's origin in an applet) will be added by the run-time environment (i.e. by the Browser's implementation of Java). Source CodeThe source code of this applet is available for download:
Additionally, the following image files are required to run "Applet_06":
|
| http://www.Andreas-Rozek.de/Java/JavaKurs/Applet_06/Applet_06.html | (last Modification: 01.05.2002) |