1

Just a quick question. I am creating an applet in Eclipse with Java. I run the program, the applet appears on the screen and everything is good. But when I hit close (cross on the applet window) it closes the window, and the clean grey window stays on the screen with words "applet disposed". Sometimes after half a minute it closes by itself.

enter image description here

How can I get rid of this window? I am on osx.

/* 
* File: Add3Inegers.java
* ---------------------------
* This program adds 3 integers.
*/

/* Library Package imports */

import acm.program.*;

//import java.awt.*;

/* Creates Add3Integers class */

public class Add3Integers extends ConsoleProgram {

    /* Set Applet window dimensions */
    public void init() {
        setSize(500, 500);
    }
    /* Creates run() method */
    public void run() {
        println("This program adds three integers.");
        int n1 = readInt("Enter first number:");
        int n2 = readInt("Enter second number:");
        int n3 = readInt("Enter third number:");
        int total = n1 + n2 + n3;
        println("The total is: " + total + ".");
    }
}
Prasad Khode
  • 6,602
  • 11
  • 44
  • 59
artpen
  • 25
  • 7

0 Answers0