GraphicsEnvironment environment=GraphicsEnvironment.getLocalGraphicsEnvironment();
device=environment.getDefaultScreenDevice();
JFrame frame=new JFrame();
frame.setUndecorated(true);//去掉所有东东,只显示窗口
frame.setResizable(false);//禁止用户修改窗体大小
device.setFullScreenWindow(frame);
if(displayMode!=null&&device.isDisplayChangeSupported())
{ try
{
device.setDisplayMode(displayMode);
}
catch(IllegalArgumentException ex)
{
}
}