日期:2014-05-16 浏览次数:21086 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> <title>Push Buttons</title> <script src="/pivot/js/deployJava.js" type="text/javascript"></script> </head> <body> <script xmlns="" type="text/javascript"> var attributes = { code:'org.apache.pivot.wtk.BrowserApplicationContext$HostApplet', width:'480', height:'360' }; var libraries = []; libraries.push("/pivot/lib/pivot-core-1.4.jar"); libraries.push("/pivot/lib/pivot-wtk-1.4.jar"); libraries.push("/pivot/lib/pivot-wtk-terra-1.4.jar"); libraries.push("/pivot/lib/pivot.jar"); attributes.archive = libraries.join(","); var parameters = { codebase_lookup:false, java_arguments:'-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true', application_class_name:'pivot.tutorials.buttons.PushButtons' }; deployJava.runApplet(attributes, parameters, "1.6"); </script> </body> </html>
<?xml version="1.0" encoding="UTF-8" ?> <project name="pivot" default="all"> <description>The Pivot Application</description> <!-- 定义文件夹 --> <property name="srcDir" location="." /> <property name="classDir" location="../webapp/WEB-INF/classes" /> <property name="libDir" location="../webapp/WEB-INF/lib" /> <property name="webDir" location="../webapp" /> <!--用于输出打包的文件夹--> <property name="tempDir" location="${java.io.tmpdir}/${ant.project.name}" /> <property name="targetDir" location="../target" /> <!-- 定义classpath --> <path id="master-classpath"> <fileset file="${libDir}/*.jar" /> <pathelement path="${classDir}" /> </path> <!-- 执行清理 --> <target name="clean"> <delete dir="${classDir}" /> <delete dir="${tempDir}" /> <delete file="${targetDir}/${ant.project.name}.jar" /> <delete file="${targetDir}/${ant.project.name}.war" /> <delete dir="${targetDir}" /> </target> <!-- 初始化任务 --> <target name="init" depends="clean"> <mkdir dir="${targetDir}" /> <mkdir dir="${tempDir}" /> <mkdir dir="${classDir}" /> </target> <!-- 编译 --> <target name="compile" depends="init" description="compile the source files"> <javac srcdir="${srcDir}" destdir="${classDir}" debug="true" encoding="UTF-8"> <classpath refid="master-classpath" /> </javac> <copy todir="${classDir}" overwrite="true"> <fileset dir="${srcDir}"> <include name="**/*.xml" /> <include name="**/*.properties" /> </fileset> </copy> </target> <!--打jar包--> <target name="jar" depends="compile"> <jar jarfile="${targetDir}/${ant.project.name}.jar"> <fileset dir="${classDir}"> <include name="**/*" /> </fileset> </jar> </target> <!—准备war包 --> <target