< prev index next >

src/demo/share/jfc/J2Ddemo/java2d/DemoPanel.java

Print this page

        

@@ -62,11 +62,11 @@
 
         setLayout(new BorderLayout());
         try {
             if (obj instanceof String) {
                 className = (String) obj;
-                obj = Class.forName(className).newInstance();
+                obj = Class.forName(className).getDeclaredConstructor().newInstance();
             }
             if (obj instanceof Component) {
                 add((Component) obj);
             }
             if (obj instanceof Surface) {
< prev index next >