Applet not running

Tags: , ,



Im fairly new to java and applet but when I run my code I expect to be greeted with some sort of applet window however nothing happens when I run. What am I doing wrong, or am I missing something ?

import java.applet.Applet;
import java.awt.*;

public class Tennis extends Applet {
    final int W = 700, H = 500;

    public void init(){
        this.resize(W,H);

    }

    public void paint (Graphics g){
        g.setColor(Color.BLACK);
        super.print(g);

    }

    public void update (Graphics g){
        paint(g);

    }

    public static void main(String[] args){

    }

}

Answer

As Java Client Roadmap Update

During the past five years, most browser vendors have withdrawn support for plugins such as Flash, Silverlight, and Java in their products. Supporting Java Applets in browsers was only possible as long as browser vendors were committed to supporting standards based plugins. By late 2015, many browser vendors had either removed or announced timelines for the removal of standards-based plugin support, while some introduced proprietary browser-specific extension APIs. Consequently:

  • Existing Applet support in Java SE 8 will continue through March 2019, after which it may be removed at any time.
  • Oracle announced in January 2016 that Applets would be deprecated in Java SE 9, and removed from Java SE 11 (18.9).

If you have Java 8 or prior installed with necessary files. You can try appletviewer



Source: stackoverflow