我正在关注Youtube上的thenewboston关于Java游戏开发的一系列教程.我正处于可以制作全屏窗口的位置,但分辨率拒绝调整为800x600.我测试了vc,一个GraphicsEnvironment.getDefaultScreenDevice对象,以及dm,一个DisplayMode,它们似乎不是问题所在.我正在运行Snow Leopard.有任何想法吗?
if(dm != null && vc.isDisplayChangeSupported()){
try{
vc.setDisplayMode(dm);
System.out.println("Display mode set");
}catch(Exception ex){System.out.println("Despite the vc saying it is display change supported and the DM is not null, something went wrong");}
}
}
Run Code Online (Sandbox Code Playgroud)