You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
750 B

  1. <?
  2. // This example is only intented to be run as a CGI.
  3. $frame = new Java("java.awt.Frame", "Zend");
  4. $button = new Java("java.awt.Button", "Hello Java world!");
  5. $frame->add("North", $button);
  6. $frame->validate();
  7. $frame->pack();
  8. $frame->visible = True;
  9. $thread = new Java("java.lang.Thread");
  10. $thread->sleep(10000);
  11. $frame->dispose();
  12. // Odd behavior noted with Sun JVMs:
  13. //
  14. // 1) $thread->destroy() will fail with a NoSuchMethodError exception.
  15. // 2) The call to (*jvm)->DestroyJVM(jvm) made when PHP terminates
  16. // will hang, unless _BOTH_ the calls to pack and setVisible above
  17. // are removed.
  18. //
  19. // Even more odd: both effects are seen with a 100% Java implementation
  20. // of the above!
  21. ?>