#!/usr/bin/php <?php include_once "java/Java.inc"; $sys = new java("java.lang.System"); $sys->setProperty("utf8", "Cześć! -- שלום -- Grüß Gott -- Dobrý deň -- Dobrý den -- こんにちは, コンニチハ"); $arr = $sys->getProperties(); foreach ($arr as $key => $value) { print $key . " -> " . java_values($value) . "<br>\n"; } ?>
// server/tests/SwingTest.php for a better swing example. It uses java // as an "execution environment" for php scripts and uses System.exit() // to avoid issues with swing's background threads. include_once "java/Java.inc"; ini_set("max_execution_time", 0); if ($argc < 2) { echo "No automatic test. Use php swing-button.php --force to run this test.\n"; exit(0); } /** * Swing's native peers are switched off by defaul t (we don't want to * run in one of the many swing related bugs or crashes). * Switch it on for this test. */ $System = new java("java.lang.System"); $System->setProperty("java.awt.headless", "false"); class SwingApplication { var $labelPrefix = "Button clicks: "; var $numClicks = 0; var $label; var $frame; function actionPerformed($e) { echo "action performed called\n"; $this->numClicks++; $this->label->setText($this->labelPrefix . $this->numClicks); } function createComponents() { $button = new java("javax.swing.JButton", "I'm a Swing button!");