error-cannot be resolved to a type

 import java.awt.Color;
import java.awt.DisplayMode;
import java.awt.Font;
import java.awt.Graphics;

import javax.swing.JFrame;

public class FullScreenTest extends JFrame {

    public static void main(String[] args) {

        DisplayMode displayMode;

        if (args.length == 3) {
            displayMode = new DisplayMode(
                Integer.parseInt(args[0]),
                Integer.parseInt(args[1]),
                Integer.parseInt(args[2]),
                DisplayMode.REFRESH_RATE_UNKNOWN);
        }
        else {
            displayMode = new DisplayMode(800, 600, 16,
                DisplayMode.REFRESH_RATE_UNKNOWN);
        }

        FullScreenTest test = new FullScreenTest();
        test.run(displayMode);
    }

    private static final long DEMO_TIME = 5000;


    public void run(DisplayMode displayMode) {
        setBackground(Color.blue);
        setForeground(Color.white);
        setFont(new Font("Dialog", 0, 24));

        SimpleScreenManager screen = new SimpleScreenManager();
        try {
            screen.setFullScreen(displayMode, this);
            try {
                Thread.sleep(DEMO_TIME);
            }
            catch (InterruptedException ex) { }
        }
        finally {
            screen.restoreScreen();
        }
    }


    public void paint(Graphics g) {
        g.drawString("Hello World!", 20, 50);
    }
}
 

I have had this error before and have tried the control-shift-o and that fixed my previous errors but this one has me confused. the program is supposed to open a full screen window for five seconds with hello world displayed and then close it. the error is SimpleScreenManager cannot be resolved to a type.

I don’t see a SimpleScreenManager class :confused:

Yup unless SimpleScreenManager is a class you wrote or a class from a library or something, it isn’t in the Java SE 1.6 (Java 6) API. That means you can’t use it cause it’s not there :wink:

To correct it just put the SimpleScreenManager class at same folder of that class above or put it on same package and import it.

thanks, I wrote the code for the simple_screen_manager but didn’t move it into a class for that project.