0

This is my code

import java.awt.*;
import java.applet.*;
public class myline extends Applet
{
public void paint(Graphics g)
{
g.drawLine(100,10,250,150);
g.drawLine(100,150,150,150);
}
}

Error shown when compiling C:\Users\Admin\Downloads>javac myline.java Note: myline.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

  • 1) Do what the error message says. Seriously. 2) The Applet class is deprecated. It was deprecated in Java 9 ... and in the Java 17 codebase it is now labeled for removal. Applets are a dead technology. It is no longer supported by modern web browsers ... apart from IE ... which EOL next year. – Stephen C Sep 05 '21 at 06:09
  • So, the best solution is to throw this code away, and stop using (and teaching!) applets. – Stephen C Sep 05 '21 at 06:10

0 Answers0