-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 に答える