--- old/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java 2019-12-19 09:50:40.000000000 +0300 +++ new/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java 2019-12-19 09:50:39.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -614,9 +614,12 @@ static ColorModel screenmodel; @Override - public Insets getScreenInsets(GraphicsConfiguration gc) - { - return getScreenInsets(((Win32GraphicsDevice) gc.getDevice()).getScreen()); + public Insets getScreenInsets(final GraphicsConfiguration gc) { + GraphicsDevice gd = gc.getDevice(); + if (!(gd instanceof Win32GraphicsDevice)) { + return super.getScreenInsets(gc); + } + return getScreenInsets(((Win32GraphicsDevice) gd).getScreen()); } @Override