抑制 JInput 警告
Suppress JInput Warnings
我的 JInput 代码工作正常,它只是在每次程序启动时将这些警告打印到控制台。我需要压制他们。
2017 年 11 月 29 日8:59:55上午net.java.games.input.DefaultControllerEnvironmentgetControllers
警告:发现未知 Windows 版本:Windows 10
2017 年 11 月 29 日 8:59:55 上午 net.java.games.input.DefaultControllerEnvironment getControllers
警告:正在尝试使用默认 windows 插件。
编辑:我找到了一种方法,但这有点麻烦:System.err.close();
有没有办法让我暂时禁用 System.err
?
解决方案是使用System.setErr()
:
PrintStream error=System.err;
System.setErr(new PrintStream(new OutputStream(){
public void write(int a){}
}));
controllers=ControllerEnvironment.getDefaultEnvironment().getControllers();
System.setErr(error);
我的 JInput 代码工作正常,它只是在每次程序启动时将这些警告打印到控制台。我需要压制他们。
2017 年 11 月 29 日8:59:55上午net.java.games.input.DefaultControllerEnvironmentgetControllers 警告:发现未知 Windows 版本:Windows 10 2017 年 11 月 29 日 8:59:55 上午 net.java.games.input.DefaultControllerEnvironment getControllers 警告:正在尝试使用默认 windows 插件。
编辑:我找到了一种方法,但这有点麻烦:System.err.close();
有没有办法让我暂时禁用 System.err
?
解决方案是使用System.setErr()
:
PrintStream error=System.err;
System.setErr(new PrintStream(new OutputStream(){
public void write(int a){}
}));
controllers=ControllerEnvironment.getDefaultEnvironment().getControllers();
System.setErr(error);