1

只是一个快速的问题。我正在使用 Java 在 Eclipse 中创建一个小程序。我运行程序,小程序出现在屏幕上,一切都很好。但是当我点击关闭(在小程序窗口上交叉)时,它会关闭窗口,并且干净的灰色窗口会留在屏幕上,并带有“小程序已处理”字样。有时半分钟后它会自行关闭。

在此处输入图像描述

我怎样才能摆脱这个窗口?我在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 + ".");
    }
}
4

0 回答 0