java.lang.Error: Unresolved compilation Probleme

dies ist mein Errorcode:

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!");
    }
}
  • du hast vergessen zu importieren, eine Klasse in Ihrem code.
  • könnten Sie sagen, welches es ist? :/
  • TextAttributes wird nicht importiert wird nicht aufgeführt wurden, werden in importierten Pakete. Das gleiche gilt für Console Klasse.
  • Blick auf die code-Zeile, ist es wahrscheinlich die TextAttributes, die man nicht importd. Wenn Sie ar auf eclipse, ein Strg+shit+a, organisieren Ihre Importe.
  • TextAttributes und Konsole, wie die Fehlermeldung zeigt. Versuchen Sie nicht, um code auszuführen, bis Sie haben behoben ALLE Fehler angezeigt, in der das "Problem" - view in Eclipse.
InformationsquelleAutor L3V0 | 2013-04-17
Schreibe einen Kommentar