0

.java uses or overrides a deprecated API. Recompile with -Xlint:deprecation for details.

import java.awt.*; 

import java.applet.*;

public class aprg4 extends Applet  
{
    public void init() 
    {
            setBackground (Color.yellow);
    }
    public void paint (Graphics g)
    {
            Dimension d = this.getSize();
            int xc = d.width/2;
            int yc = d.height/2;
            int r = 100;
            g.setColor (Color.red);
            g.fillOval(xc-r, yc-r,2*r,2*r);
     }
}

/*
 <applet code=aprg4 width=600 height=400>
</applet>
 Not able to check applet
*/
Roberto Caboni
  • 7,252
  • 10
  • 25
  • 39
Rudra
  • 1
  • 1
  • 1
    `Applet` are deprecated from jdk9, for further details check [deprecated features](https://www.oracle.com/technetwork/java/javase/9-deprecated-features-3745636.html) – dariosicily Jun 30 '20 at 20:24
  • What's your question ? – howie Jul 02 '20 at 01:33
  • So in this case, the real solution is to stop using applets. (And if your teacher is still teaching you to program using applets, suggest respectfully that they need to update their course content / syllabus.) – Stephen C Dec 24 '20 at 10:41

0 Answers0