(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

There are three possible downloads.
  OS X Application

Click the icon to download the zip file; double click the zip file to unzip; double click the app file to launch.



  Web Start Application

Click the icon to download the jnlp file; double click the jnlp file to launch. (You may need to accept the security certificate provided.)



  JAR Application

Click the icon to download the jar file; launch the jar file either by double-clicking the icon or by typing "java -jar toy.jar" at the command line.


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)