Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-17-2009, 04:40 PM
Manfizy's Avatar
Senior Member
 
Join Date: Nov 2008
Location: Germany
Posts: 165
Rep Power: 2
Manfizy is on a distinguished road
Send a message via Yahoo to Manfizy
Post JFileCjooser--java.lang.RuntimeException: java.io.IOException: Could not get shell fo
Hi, i get an error java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list
when i try to use JFile chosser

does anybody know how to woh around this proble?

Code:
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list
        at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:506)
        at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Win32ShellFolder2.java:563)
        at sun.awt.shell.Win32ShellFolderManager2.getRecent(Win32ShellFolderManager2.java:112)
        at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.java:251)
        at sun.awt.shell.ShellFolder.get(ShellFolder.java:219)
        at sun.swing.WindowsPlacesBar.<init>(WindowsPlacesBar.java:64)
        at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.updateUseShellFolder(WindowsFileChooserUI.java:512)
        at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponents(WindowsFileChooserUI.java:194)
        at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:136)
        at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(WindowsFileChooserUI.java:127)
        at javax.swing.JComponent.setUI(JComponent.java:673)
        at javax.swing.JFileChooser.updateUI(JFileChooser.java:1763)
        at javax.swing.JFileChooser.setup(JFileChooser.java:360)
        at javax.swing.JFileChooser.<init>(JFileChooser.java:333)
        at javax.swing.JFileChooser.<init>(JFileChooser.java:286)
        at MyXenonConc.XenonConcUI.jMenuItem3ActionPerformed(XenonConcUI.java:1909)
        at MyXenonConc.XenonConcUI.access$300(XenonConcUI.java:31)
        at MyXenonConc.XenonConcUI$7.actionPerformed(XenonConcUI.java:1267)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
        at java.awt.Component.processMouseEvent(Component.java:6134)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
        at java.awt.Component.processEvent(Component.java:5899)
        at java.awt.Container.processEvent(Container.java:2023)
        at java.awt.Component.dispatchEventImpl(Component.java:4501)
        at java.awt.Container.dispatchEventImpl(Container.java:2081)
        at java.awt.Component.dispatchEvent(Component.java:4331)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
        at java.awt.Container.dispatchEventImpl(Container.java:2067)
        at java.awt.Window.dispatchEventImpl(Window.java:2458)
        at java.awt.Component.dispatchEvent(Component.java:4331)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
__________________
We Learn Through Mistakes..,
Manfizy

Last edited by Manfizy; 06-17-2009 at 05:13 PM.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 06-18-2009, 12:47 AM
Darryl.Burke's Avatar
Senior Member
 
Join Date: Sep 2008
Location: Madgaon, Goa, India
Posts: 732
Rep Power: 2
Darryl.Burke is on a distinguished road
Default
Post your code, in the form of an SSCCE.
SSCCE : Java Glossary

db
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-18-2009, 10:44 AM
Manfizy's Avatar
Senior Member
 
Join Date: Nov 2008
Location: Germany
Posts: 165
Rep Power: 2
Manfizy is on a distinguished road
Send a message via Yahoo to Manfizy
Post
what i posted above is the error that i get when i try to invoke JFileChooser.

Am tempted to think that its something to do with windows Look and feel not accepting the way i am using JFileChooser because if i use another LookAndFeel it works properly.

This is how i am doing it

Code:
final JFileChooser fc = new JFileChooser();

fc.setCurrentDirectory(new File("."));

int returnVal = fc.showOpenDialog(jMenuItem3);

if(returnVal == JFileChooser.APPROVE_OPTION) {
   File file = fc.getSelectedFile();

   String f =file.getName();
try {

//At this point i read data in the file 
......
......
}catch (IOException e) {
      e.printStackTrace();
     }
And for the look and feel, this is how i implement it

Code:
  public static void main(String args[]) {
          java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");

                } catch (ClassNotFoundException ex) {
                    Logger.getLogger(XenonConcUI.class.getName()).log(Level.SEVERE, null, ex);
                } catch (InstantiationException ex) {
                    Logger.getLogger(XenonConcUI.class.getName()).log(Level.SEVERE, null, ex);
                } catch (IllegalAccessException ex) {
                    Logger.getLogger(XenonConcUI.class.getName()).log(Level.SEVERE, null, ex);
                } catch (UnsupportedLookAndFeelException ex) {
                    Logger.getLogger(XenonConcUI.class.getName()).log(Level.SEVERE, null, ex);
                }

             new XenonConcUI().setVisible(true);
           }
        });
    }
__________________
We Learn Through Mistakes..,
Manfizy
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 06-24-2009, 06:02 AM
Senior Member
 
Join Date: Dec 2008
Posts: 197
Rep Power: 2
Webuser is on a distinguished road
Default
Quote:
fc.setCurrentDirectory(new File("."));
Actually, as a rule, File class demands for an absolute file path or just a project package path... Try to use list method instead...
Report if that helped )
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 06-24-2009, 07:34 AM
Manfizy's Avatar
Senior Member
 
Join Date: Nov 2008
Location: Germany
Posts: 165
Rep Power: 2
Manfizy is on a distinguished road
Send a message via Yahoo to Manfizy
Post
Actually when i run the same program in vista using the windows look and feel i dont get errors but if i run it in XP i get the error. I dont understand why it has to be that way. Anyway, am going to try your method and give you feed back

cheerz!
__________________
We Learn Through Mistakes..,
Manfizy
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String) baltimore New To Java 2 09-18-2008 08:30 AM
Error: unreported exception java.io.IOException; ?? jonsamwell New To Java 5 08-24-2008 05:11 AM
java.io.IOException: CreateProcess: matlab error=2 Jack Advanced Java 3 04-10-2008 10:01 AM
java.io.IOException: invalid header field osval Advanced Java 1 08-07-2007 12:09 AM
java.lang.RuntimeException+ Axis Peter Advanced Java 1 07-05-2007 02:43 PM


All times are GMT +2. The time now is 04:33 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org