Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JFileChooser initialization very slow in Java 1.8

Pooja ReddyDec 4 2017 — edited Dec 4 2017

Hi,

Our application is in Java 1.8.0_121. We are using "JFileChooser"  and see that its ridiculously slow always (not just first time)

Below is the thread dump stack trace which tells what was event thread doing then

"AWT-EventQueue-2" prio=0 tid=30 nid=0 waiting on condition [on lock java.util.concurrent.FutureTask@6094903e]

    java.lang.Thread.State: WAITING (parking)

    at sun.misc.Unsafe.park(Native Method)

    at java.util.concurrent.locks.LockSupport.park(Unknown Source)

    at java.util.concurrent.FutureTask.awaitDone(Unknown Source)

    at java.util.concurrent.FutureTask.get(Unknown Source)

    at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Unknown Source)

    at sun.awt.shell.ShellFolder.invoke(Unknown Source)

    at sun.awt.shell.Win32ShellFolder2.listFiles(Unknown Source)

    at sun.awt.shell.ShellFolder.listFiles(Unknown Source)

    at sun.awt.shell.Win32ShellFolderManager2.get(Unknown Source)

    at sun.awt.shell.ShellFolder.get(Unknown Source)

    at javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxModel.addItem(Unknown Source)

    at javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxModel.access$800(Unknown Source)

    at javax.swing.plaf.metal.MetalFileChooserUI.doDirectoryChanged(Unknown Source)

    at javax.swing.plaf.metal.MetalFileChooserUI.access$1100(Unknown Source)

    at javax.swing.plaf.metal.MetalFileChooserUI$5.propertyChange(Unknown Source)

    at java.beans.PropertyChangeSupport.fire(Unknown Source)

    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)

    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)

    at java.awt.Component.firePropertyChange(Unknown Source)

    at javax.swing.JFileChooser.setCurrentDirectory(Unknown Source)

    at javax.swing.JFileChooser.<init>(Unknown Source)

  at javax.swing.JFileChooser.<init>(Unknown Source

We see the same stacktrace everytime this slowness is observed.

Can you guys please help in identified what is the problem here ? I dont see any huge files in the default directory which is "My Documents"

Any code changes needed to be done to fix this ?

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2018
Added on Dec 4 2017
0 comments
1,084 views