-1

这是我的错误代码:

Exception in thread "main" : 
TextAttributes cannot be resolved to a type
TextAttributes cannot be resolved to a type
Console cannot be resolved to a type

    at Font.main(Font.java:8)

import java.awt.Color;
import enigma.console.*;
import enigma.core.Enigma;
public class Main
{
    public static void main(String[] args)
    {
        TextAttributes attrs = new TextAttributes(Color.BLUE, Color.WHITE);
        s_console.setTextAttributes(attrs);
        System.out.println("Hello World!");
    }
    private static final Console s_console;
    static
    {
        s_console = Enigma.getConsole("Hellow World!");
    }
}
4

1 回答 1

3

不要关注评论,他们是错误的。问题不在于您的导入,而在于您的环境。如果您在 IDE 中运行代码,请尝试清理您的环境。我只是尝试在控制台中编译和运行您的代码,它工作正常。

于 2013-04-17T08:28:43.930 回答