How can I interact with Applets in DrJava?
Williams College has developed a library known as ObjectDraw which allows users to easily display and run Java Applets outside of a web browser. The ObjectDraw library can be downloaded as a Jar from http://applecore.cs.williams.edu/~cs134/eof/library/objectdraw.jar (You may need to right-click on the above link to choose the “Save Link Target As…” option in your web browser.) You can then add the objectdraw.jar file to DrJava’s Extra Classpath option in the Preferences window to make it available within DrJava. For example, suppose you have written an Applet class named MyApplet. After compiling it, enter the following lines in the Interactions Pane to run the Applet: Note: There appears to be a bug in ObjectDraw in which it does not call the applet’s init() method before running it. A workaround is to call the init() method manually before creating the AppletFrame. import objectdraw.AppletFrame; MyApplet applet = new MyApplet(); applet.
Related Questions
- What can I do if a child rejects my efforts to interact with him and seems more interested in engaging in self-stimulatory behaviors (e.g., patting self or objects)?
- My child dislikes having his hands touched or manipulated. How can we interact with him in a more acceptable way?
- How can I interact with Applets in DrJava?