(Booksite) (CS Dept.) (Princeton)


Before you start

Before you start, you will need a JVM (Java Virtual Machine) which conforms to the Java 1.6 (or newer) specification. If you followed the Hello, World instructions for COS 126, you already have it. Otherwise, go to java.com and click the Free Java Download button.

Installing Visual X-TOY for Java 1.6

There two possible downloads. Launch the Web Start Application by clicking the first icon (and accept the security certificate). To download the JAR Application, right-click the icon and save it to your desktop. Then, launch it either by double-clicking the desktop icon (or by typing "java -jar toy.jar" at the command line).
Web Start Application

JAR Application

Q & A

Q. I'm running Windows but the Web Start application doesn't launch the X-TOY simulator. What should I do?
A. Windows patches have been known to break Java as a side effect. If this happens to you, go to java.com and click the Get It Now button.

Q. I'm running Mac OS X but the Web Start application says that toy.jnlp can't be opened because it is from an unidentified developer.
A. You can override this via System Preferences -> Security & Privacy -> General -> Open Anyway.

Q. I'm running Mac OS X but the Web Start application says that toy.jnlp can't be opened because it is from an unidentified developer.
A. You can override this via System Preferences -> Java -> Security -> Exception Site List -> Edit Site List and adding http://introcs.cs.princeton.edu.

Q. Sometimes 'Reset' clears stdin, and sometimes it doesn't. How does Visual X-TOY decide when to clear stdin and when not to?
A. Editing stdin in 'Edit Mode' changes the state to which stdin resets, whereas editing stdin in any other mode only changes the current state of stdin.

Q. When I open up files, sometimes Visual X-TOY opens a new window, and sometimes it reuses the current window. How does Visual X-TOY decide when to reuse the current window?
A. Whenever you open several files at once, Visual X-TOY always opens new windows. However, when opening a single file, Visual X-TOY will reuse the current window if and only if the file has not been changed since it was last saved.

Links

Source Code
Source Code Documentation (No Frames)