0

Can anyone help me with this code? I'm getting a compile time error as depricated API

import java.applet.Applet; import java.awt.Graphics;    /* <applet code="HelloWorld" width=200 height=60> </applet> */    // HelloWorld class extends Applet public class HelloWorld extends Applet  {     // Overriding paint() method     @Override     public void paint(Graphics g)      {         g.drawString("Hello World", 20, 20);     }        }

1st Apr 2020, 6:05 AM
Gnana phanideep Pothini
Gnana phanideep Pothini - avatar
2 ответов
+ 1
You have to use JDK 8 or any older versions to use Applet and Graphics because they are deprecated and are not supported by the new versions of JDK.
1st Apr 2020, 7:03 AM
Avinesh
Avinesh - avatar
0
Thanks
1st Apr 2020, 7:23 AM
Gnana phanideep Pothini
Gnana phanideep Pothini - avatar