I am trying to learn about Java Applets in VSCode but am not able to get through the intricacies. This is my java code in main.java file:
import java.applet.*;
import java.awt.Graphics;
@SuppressWarnings("removal")
public class main extends Applet {
public void paint(Graphics g) {
g.drawOval(100, 100, 300, 300);
g.drawString("Geeky Shows", 230, 250);
}
}
I type in 2 commands in the terminal to run it.
javac main.java
appletviewer main.java
The terminal loads for a split second but then nothing happens.
My java version:
➜ applets git:(main) ✗ java --version
openjdk 21.0.2 2024-01-16 LTS
OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode)
➜ applets git:(main) ✗
mac arch:
➜ applets git:(main) ✗ uname -m
arm64
➜ applets git:(main) ✗
Am I doing something wrong?