Loading... # Background The DSA course in this term provided some visualization programs for understanding data structures and algorithms. However, all of them are applet programs. Applet can run with proper JAVA environment simply in browsers in the past, but they are not supported by modern browsers any more. Meanwhile, current JAVA environment of a higher version doesn't support it either. # Solution ## Method that Works Perfectly There's a relatively simple way to run applet. I have tested it on macOS, and I guess it's similar on Linux or even Windows. 1) Install IntelliJ IDEA. 2) Open IDEA and click "New Project". ![open the idea.png] 3) Download JRE of old version. (Newer versions don't support it.) In the selection menu of JDK, you can download JDKs that are not installed on your computer. And you can choose to download an version that is old enough. ![download other JDK.png] ![select JDK to download.png] 4) Run with commands! Now the IDEA can be closed. (You don't need to really create a project.) Enter the directory where `*.applet` exists, and run it with `appletviewer *.applet` command. ```shell ❯ l total 120 drwxr-x---@ 11 colin staff 352B Jan 6 09:18 . drwxr-x---@ 11 colin staff 352B Jan 6 15:45 .. -rw-r-----@ 1 colin staff 39K Dec 2 2019 avl_seanet.jar drwxr-x---@ 19 colin staff 608B Feb 16 2019 images -rw-r-----@ 1 colin staff 144B Dec 2 2019 index.applet drwxr-x---@ 5 colin staff 160B Feb 16 2019 sounds drwxr-x---@ 19 colin staff 608B Jan 6 08:48 src ❯ appletviewer index.applet ``` ![demo.png] ## Other Attempts Before I found the method above, I tried with a Chrome extension ["CheerpJ Applet Runner"](https://chrome.google.com/webstore/detail/cheerpj-applet-runner/bbmolahhldcbngedljfadjlognfaaein/). Note that it doesn't support running a local file so you can't just drag the applet into Chrome. If you do so, it says "file://" is not supported, and it needs a web server. Luckily, it can be done easily via running a http server with a single python line `python3 -m http.server 9090`. After that, you can change the file `index.applet` to `applet.html`, and open the html in the browser. The extension can run applets. However, it doesn't perform very well. When I opened the [online demo](https://dsa.cs.tsinghua.edu.cn/~deng/ds/demo/) provided by the teacher, or ran the applet hosted by my local http server, the main window of applets could be shown, but the functions didn't work. So the extension only has limited support for running applets. : https://blog.valderfield.com/usr/uploads/2021/01/913316837.png : https://blog.valderfield.com/usr/uploads/2021/01/478090694.png : https://blog.valderfield.com/usr/uploads/2021/01/2988722171.png : https://blog.valderfield.com/usr/uploads/2021/01/2864445499.png Last modification：January 7, 2021 © Allow specification reprint Support Appreciate the author Like 0 如果觉得我的文章对你有用，请随意赞赏
Hi Collin, you may also want to have a look at the free "Applet Runner" plugin. Still in beta at the moment but it supports also local files. Disclaimer: I'm the author.
您好，安装低版本JDK之后，输入appletviewer *.applet还是显示 The operation couldn’t be completed. Unable to locate a Java Runtime that supports appletviewer.Please visit http://www.java.com for information on installing Java.
仅凭这些信息我无法提供帮助。或许你可以和我进一步沟通，比如把错误截图等发到我的邮箱 firstname.lastname@example.org 。如果你是 THUer ，你可以线下来找我。