Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4428090

In Windows <class>.newInstance() is not creating new instance of JFileChooser

XMLWordPrintable

    • generic
    • windows_nt

      In Windows using <class>.newInstance() is not creating a new instance of the class represented by the Class Object, for JFileChooser in build56.

      When trying to create a new instance of the class JFileChooser it throws the following Exception:
      --------------------------------------------------------------------------------
      Exception in thread "main" java.lang.InternalError: Could not parse file path
              at sun.awt.shell.Win32ShellFolder.initFile(Native Method)
              at sun.awt.shell.Win32ShellFolder.<init>(Win32ShellFolder.java:174)
              at sun.awt.shell.Win32ShellFolder.getCanonicalFile(Win32ShellFolder.java
      :616)
              at javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxModel.addI
      tem(MetalFileChooserUI.java:1451)
              at javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxModel.acce
      ss$2200(MetalFileChooserUI.java:1415)
              at javax.swing.plaf.metal.MetalFileChooserUI.doDirectoryChanged(MetalFil
      eChooserUI.java:1156)
              at javax.swing.plaf.metal.MetalFileChooserUI.access$2400(MetalFileChoose
      rUI.java:37)
              at javax.swing.plaf.metal.MetalFileChooserUI$11.propertyChange(MetalFile
      ChooserUI.java:1257)
              at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Swing
      PropertyChangeSupport.java:268)
              at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Swing
      PropertyChangeSupport.java:236)
              at javax.swing.JComponent.firePropertyChange(JComponent.java:3695)
              at javax.swing.JFileChooser.setCurrentDirectory(JFileChooser.java:515)
              at javax.swing.JFileChooser.<init>(JFileChooser.java:319)
              at javax.swing.JFileChooser.<init>(JFileChooser.java:271)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(../../../src/sh
      are/classes/sun/reflect/NativeConstructorAccessorImpl.java:33)
              at sun.reflect.InflatableConstructorAccessorImpl.newInstance(../../../sr
      c/share/classes/sun/reflect/InflatableConstructorAccessorImpl.java:38)
              at java.lang.reflect.Constructor.newInstance(../../../src/share/classes/
      java/lang/reflect/Constructor.java:273)
              at java.lang.Class.newInstance0(../../../src/share/classes/java/lang/Cla
      ss.java:284)
              at java.lang.Class.newInstance(../../../src/share/classes/java/lang/Clas
      s.java:243)
              at TestInstantiate.main(TestInstantiate.java:19)
      ---------------------------------------------------------------------------------Sample code is attached(TestInstantiate.java).

      How to Reproduce the Bug:
      --------------------------
      1.)Compile the sample java code(TestInstantiate.java) in build56.
      2.)Run the TestInstantiate.java.
      3.)If the exception thrown is same the above given exception the bug is reproduced.

            leifs Leif Samuelsson (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: