Escolar Documentos
Profissional Documentos
Cultura Documentos
Examples on Windows
D:\demo> java -version
java version "1.1.7A"
D:\demo> rem HowToP.java = a simple program
D:\demo> javac HowToP.java
D:\demo> java HowToP 4
Welcome to the HowToP program
Countdown at 4
Press Return to continue
Countdown at 3
Press Return to continue
Countdown at 2
Press Return to continue
Countdown at 1
Press Return to continue
Countdown finished
D:\demo> rem HowToG.java = a simple GUI program (using AWT, not Swing)
D:\demo> javac HowToG.java
D:\demo> java HowToG 4
( screenshot of the GUI window )
Countdown finished
D:\demo> rem HowToA.java = a simple applet
D:\demo> javac HowToA.java
D:\demo> appletviewer HowToA.html
( screenshot 1 of the GUI window )
( screenshot 2 of the GUI window )
D:\demo> rem
( screenshot
( screenshot
( screenshot
Can also
1 of the
2 of the
3 of the
view HowToA.html
browser window browser window browser window -
with a browser
java disabled )
start of countdown )
end of countdown )
Examples on MPE/iX
:hello lars,demo.webkit
:showvar hpversion
HPVERSION = C.55.00
:# let's select the older JDK for this demo
:setvar java_home "/usr/local/java/jdk1.1.7"
:java -version
java version "JDK 1.1.7B"
:# HowToP.java = a simple program
:chdir ./programs
CWD is "/WEBKIT/PUB/programs".
:javac HowToP.java
:java HowToP 4
Welcome to the HowToP program
Countdown at 4
Press Return to continue
Countdown at 3
Press Return to continue
Countdown at 2
Press Return to continue
Countdown at 1
Press Return to continue
Countdown finished
:
:# HowToG.java = a simple GUI program (using AWT, not Swing)
:javac HowToG.java
:# MPE/iX does not have a GUI display
:# you might try RemoteAWT from alphaworks.ibm.com
:# or else run the program on PC using Samba/iX...
D:\> java -version
java version "1.1.7A"
D:\> java -classpath %classpath%;F:\PUB\programs HowToG 4
( screenshot of the GUI window )
Countdown finished
D:\> rem back to the 3000 now...
:# HowToA.java = a simple applet
:chdir ../htdocs
CWD is "/WEBKIT/PUB/htdocs".
:javac HowToA.java
:stream /WEBKIT/PUB/lib/httpd.job
#J144
:# surf to http://my3000.grc.hp.com:3001/HowToA.html now
( screenshot 1 of the browser window - java disabled )
( screenshot 2 of the browser window - start of countdown )
( screenshot 3 of the browser window - end of countdown )
:# HowToS.java = a simple servlet
:chdir ../servlets
CWD is "/WEBKIT/PUB/servlets".
:setvar classpath ":/WEBKIT/PUB/lib/jsdk.jar"
:javac HowToS.java
:# optionally register servlet in /WEBKIT/PUB/etc/zone.properties
:# or else run it by its real name (and with no/default initArgs)
:stream /WEBKIT/PUB/lib/jserv.job
#J145
:# surf to http://my3000.grc.hp.com:3001/servlet/HowToS now
( screenshot 1 of the browser window - start of countdown )
( screenshot 1a of the browser window - html source )
( screenshot 2 of the browser window - near end of countdown )
( screenshot 3 of the browser window - end of countdown )
( screenshot 3a of the browser window - html source )
:bye