下面列出了javax.swing.JWindow#getGraphicsConfiguration ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private static void safeSetBackground(JWindow window, Color background) {
GraphicsConfiguration gc = window.getGraphicsConfiguration();
if (!gc.isTranslucencyCapable()) return; // PERPIXEL_TRANSLUCENT not supported
if (gc.getDevice().getFullScreenWindow() == window) return; // fullscreen windows not supported
window.setBackground(background);
}
private static void safeSetBackground(JWindow window, Color background) {
GraphicsConfiguration gc = window.getGraphicsConfiguration();
if (!gc.isTranslucencyCapable()) return; // PERPIXEL_TRANSLUCENT not supported
if (gc.getDevice().getFullScreenWindow() == window) return; // fullscreen windows not supported
window.setBackground(background);
}
private static void safeSetBackground(JWindow window, Color background) {
GraphicsConfiguration gc = window.getGraphicsConfiguration();
// if (!gc.isTranslucencyCapable()) return; // PERPIXEL_TRANSLUCENT not supported // doesn't work well with [email protected], handled in catch below
if (gc.getDevice().getFullScreenWindow() == window) return; // fullscreen windows not supported
// PERPIXEL_TRANSLUCENT not supported, safely ignore
try { window.setBackground(background); }
catch (UnsupportedOperationException e) {}
}