php-src/ext/rpc/java/jawt.php
Sam Ruby d17a12319f @ Added Zend OO syntax overloading support for Java components
#
# My lawyer made me do this:
#
Users of PHP are hereby granted a non-exclusive, irrevocable, world-wide,
royalty-free, non-transferable license to use, execute, prepare derivative
works of, and distribute (internally and externally, and including derivative
works) the code accompanying this license as part of, and integrated into PHP.
WARRANTY OF ANY KIND EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
AND ANY WARRANTY OF NON-INFRINGEMENT.  THE ENTIRE RISK ARISING OUT OF THE USE
OR PERFORMANCE OF THIS CODE REMAINS WITH USERS OF PHP.  The owner of this code
represents and warrants that it is legally entitled to grant the above license.
1999-11-09 12:02:22 +00:00

29 lines
838 B
PHP

<?
// this example makes about as much sense from a web server perspective as,
// say, launching and interacting with Microsoft word. <grin>
$frame = new Java("java.awt.Frame", "Zend");
$button = new Java("java.awt.Button", "Hello Java world!");
$frame->add("North", $button);
$frame->validate();
$frame->pack();
$frame->visible = True;
$thread = new Java("java.lang.Thread");
$thread->sleep(10000);
$frame->dispose();
// Odd behavior noted with Sun JVMs:
//
// 1) $thread->destroy() will fail with a NoSuchMethodError exception.
// 2) The call to (*jvm)->DestroyJVM(jvm) made when PHP terminates
// will hang, unless _BOTH_ the calls to pack and setVisible above
// are removed.
//
// Even more odd: both effects are seen with a 100% Java implementation
// of the above!
?>