< prev index next >

src/java.desktop/share/classes/java/awt/Toolkit.java

Print this page

        

*** 466,476 **** * @param atName the name of the class to be loaded */ private static void fallbackToLoadClassForAT(String atName) { try { Class<?> c = Class.forName(atName, false, ClassLoader.getSystemClassLoader()); ! c.newInstance(); } catch (ClassNotFoundException e) { newAWTError(e, "Assistive Technology not found: " + atName); } catch (InstantiationException e) { newAWTError(e, "Could not instantiate Assistive Technology: " + atName); } catch (IllegalAccessException e) { --- 466,476 ---- * @param atName the name of the class to be loaded */ private static void fallbackToLoadClassForAT(String atName) { try { Class<?> c = Class.forName(atName, false, ClassLoader.getSystemClassLoader()); ! c.getConstructor().newInstance(); } catch (ClassNotFoundException e) { newAWTError(e, "Assistive Technology not found: " + atName); } catch (InstantiationException e) { newAWTError(e, "Could not instantiate Assistive Technology: " + atName); } catch (IllegalAccessException e) {
*** 581,599 **** } } } try { if (cls != null) { ! toolkit = (Toolkit)cls.newInstance(); if (GraphicsEnvironment.isHeadless()) { toolkit = new HeadlessToolkit(toolkit); } } ! } catch (final InstantiationException ignored) { ! throw new AWTError("Could not instantiate Toolkit: " + nm); ! } catch (final IllegalAccessException ignored) { ! throw new AWTError("Could not access Toolkit: " + nm); } return null; } }); if (!GraphicsEnvironment.isHeadless()) { --- 581,597 ---- } } } try { if (cls != null) { ! toolkit = (Toolkit)cls.getConstructor().newInstance(); if (GraphicsEnvironment.isHeadless()) { toolkit = new HeadlessToolkit(toolkit); } } ! } catch (final ReflectiveOperationException ignored) { ! throw new AWTError("Could not create Toolkit: " + nm); } return null; } }); if (!GraphicsEnvironment.isHeadless()) {
< prev index next >