simple screen manager

import java.awt.*;
import javax.swing.JFrame;
public class screenmanager {
public static void main(String args[]) {}
private GraphicsDevice device;

public screenmanager() {
	[b]GraphicsEnviorment[/b] enviorment =
		[b]graphicsEnviorment[/b].getLocalGraphicsEnviorment();
	device = enviorment.getDefaultScreenDevice();
}
 public void setFullScreen(DisplayMode displaymode, JFrame window ){
	 window.setUndecorated (true);
	 window.setResizable(false);
	 
	 device .setFullScreenWindow(window);
	 if (displaymode != null &&
			 device.isDisplayChangeSupported()){
		 try{
			 device.setDisplayMode([b]displayMode[/b]);
		 }
		 catch ([b]illegalArgumentException[/b] ex) {
			 
		 
		 }
	 }
 }

public Window getFullScreenWindow() {
return device.getFullScreenWindow();
}

public void restoreScreen() {
Window window = device.getFullScreenWindow();
if (window != null) {
window.dispose();
}
device.setFullScreenWindow(null);
}

}
bold areas giving me a " insert-bold-text-here cannot (be) resolve(d) to …" 1 “a type” 2 cannot be resolved 3 “to a variable” 4 “a type” error

please explain how to fix the error and what is causing it

You’re missing some imports .

If you’re on Eclipse, try hitting Ctrl+Shift+o .

ps1 :



/*please use the code tag when posting code */


ps2 : The thread subject should have something to do with your problem. For example your subject could be " compile error : X cannot be resolved to a variable. "

All bold words are misspelled. Remember Java is case sensitive.

  1. GraphicsEnviorment = supposed to be “GraphicsEnvironment”
  2. displayMode = supposed to be “displaymode”
  3. illegalArgumentException = supposed to be “IllegalArgumentException”

And as teletubo said, please use the [code] enter code here [/code] tags when pasting any code.

thanks ra4king, and Telotube not only for debugging advice but for how to post code and properly name my threads ;D