N
N
NameOf Var2017-02-13 20:39:56
Java
NameOf Var, 2017-02-13 20:39:56

Why is Java Applet not showing up in IE 11?

Java Applet not showing up in IE 11. Source code taken from "Java 7 Beginner's Guide 5th Edition":

spoiler
import java.applet.*;
import java.awt.*;

/*
    <applet code="Application.class" width=300 height=80>
      <param name=author value="Herb Schildr">
      <param name=purpose value="Demonstrate Parameters">
      <param name=version value=2>
    </applet>
 */
public class Application extends Applet  {
    String author;
    String purpose;
    int ver;

    public void start() {
        String temp;
        author = getParameter("author");
        if (author == null)
            author = "not found";
        purpose = getParameter("purpose");
        if (purpose == null)
            purpose = "not found";
        temp = getParameter("version");
        try {
            if (temp != null)
                ver = Integer.parseInt(temp);
            else
                ver = 0;
        }
        catch (NumberFormatException err) {
            ver = -1;
        }
    }

    public void paint (Graphics graph) {
        graph.drawString("Purpose: " + purpose, 10, 20);
        graph.drawString("By: " + author, 10, 40);
        graph.drawString("Version: " + ver, 10, 60);
    }
}

Browser security settings:
cf4712166ebc4cbbbb9c383d4370a936.png62cbe9d0000c4446bb505974d0bc2742.png
Configure Java:
ac0ca0e53b234bc49cc36a16c6ce74c2.png
Create an HTML file with the code:
<applet code="Application.class" width=300 height=80>
      <param name=author value="Herb Schildr">
      <param name=purpose value="Demonstrate Parameters">
      <param name=version value=2>
    </applet>

I compile Appllication.java into Application.class via javac.
I open an HTML file with IE 11 and nothing. Blank screen. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Kornachev, 2017-02-14
@zelan

Skip the chapter on applets. Browser support has been discontinued. The technology is not used anywhere.

B
bychok300, 2017-02-14
@bychok300

Applets are dead, if you want a web application, then these are servlets, and Spring is better

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question