Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I interact with Applets in DrJava?

applets drjava interact
0
0 Posted

How can I interact with Applets in DrJava?

0
0

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 is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123