关闭applet后Java applet配置窗口

时间:2014-04-14 16:11:50

标签: java applet acm-java-libraries

只是一个简单的问题。我正在使用Java在Eclipse中创建一个applet。 我运行程序,小程序出现在屏幕上,一切都很好。 但是当我靠近(在小程序窗口上交叉)它关闭窗口时,干净的灰色窗口会停留在屏幕上,并显示单词" applet "。有时半分钟后它会自动关闭。

enter image description here

如何摆脱这个窗口?我在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 + ".");
    }
}

0 个答案:

没有答案