Exception NumberFormatException when creating an instance of JFileChooser

Discussion in 'Java' started by noreic@gmail.com, Aug 30, 2005.

  1. Guest

    Hi,

    I getting a NumberFormatException executing the following code:

    JFileChooser fc = new JFileChooser();

    The following line is called in my code in
    ...
    ReadFileFrame.<init>() line: 23
    ...

    Yes, it is simple JFileChooser instance... I'm using JDK 1_5, Swing in
    a XP Pro machine and the only thing that I can remember that have been
    changed in my environment was a Windows Update.

    Based in the stack, I believe that something is broken in the way that
    Java is getting some Windows UI data.

    The stack:

    Thread [AWT-EventQueue-0] (Suspended (exception NumberFormatException))
    Integer.parseInt(String, int) line: 447
    Integer.parseInt(String) line: 497
    Win32ShellFolderManager2.get(String) line: 234
    ShellFolder.get(String) line: 221
    WindowsLookAndFeel$LazyWindowsIcon.createValue(UIDefaults) line: 1876
    UIDefaults.getFromHashtable(Object) line: 183
    UIDefaults.get(Object) line: 128
    MultiUIDefaults.get(Object) line: 44
    MultiUIDefaults(UIDefaults).getIcon(Object) line: 409
    UIManager.getIcon(Object) line: 613
    WindowsFileChooserUI(BasicFileChooserUI).installIcons(JFileChooser)
    line: 237
    WindowsFileChooserUI(BasicFileChooserUI).installDefaults(JFileChooser)
    line: 219
    WindowsFileChooserUI(BasicFileChooserUI).installUI(JComponent) line:
    135
    WindowsFileChooserUI.installUI(JComponent) line: 140
    JFileChooser(JComponent).setUI(ComponentUI) line: 650
    JFileChooser.updateUI() line: 1755
    JFileChooser.setup(FileSystemView) line: 366
    JFileChooser.<init>(File, FileSystemView) line: 332
    JFileChooser.<init>() line: 285
    ReadFileFrame.<init>() line: 23
    DecAid.readFile() line: 1086
    DecAid.access$1(DecAid) line: 1059
    DecAid$ActionListenerAdapter.actionPerformed(ActionEvent) line: 2532
    JMenuItem(AbstractButton).fireActionPerformed(ActionEvent) line: 1849
    AbstractButton$Handler.actionPerformed(ActionEvent) line: 2169
    DefaultButtonModel.fireActionPerformed(ActionEvent) line: 420
    DefaultButtonModel.setPressed(boolean) line: 258
    JMenuItem(AbstractButton).doClick(int) line: 302
    WindowsMenuItemUI(BasicMenuItemUI).doClick(MenuSelectionManager) line:
    1000
    BasicMenuItemUI$Handler.mouseReleased(MouseEvent) line: 1041
    JMenuItem(Component).processMouseEvent(MouseEvent) line: 5488
    JMenuItem(JComponent).processMouseEvent(MouseEvent) line: 3093
    JMenuItem(Component).processEvent(AWTEvent) line: 5253
    JMenuItem(Container).processEvent(AWTEvent) line: 1966
    JMenuItem(Component).dispatchEventImpl(AWTEvent) line: 3955
    JMenuItem(Container).dispatchEventImpl(AWTEvent) line: 2024
    JMenuItem(Component).dispatchEvent(AWTEvent) line: 3803
    LightweightDispatcher.retargetMouseEvent(Component, int, MouseEvent)
    line: 4212
    LightweightDispatcher.processMouseEvent(MouseEvent) line: 3892
    LightweightDispatcher.dispatchEvent(AWTEvent) line: 3822
    JFrame(Container).dispatchEventImpl(AWTEvent) line: 2010
    JFrame(Window).dispatchEventImpl(AWTEvent) line: 1766
    JFrame(Component).dispatchEvent(AWTEvent) line: 3803
    EventQueue.dispatchEvent(AWTEvent) line: 463
    EventDispatchThread.pumpOneEventForHierarchy(int, Component) line: 234
    EventDispatchThread.pumpEventsForHierarchy(int, Conditional,
    Component) line: 163
    EventDispatchThread.pumpEvents(int, Conditional) line: 157
    EventDispatchThread.pumpEvents(Conditional) line: 149
    EventDispatchThread.run() line: 110
     
    , Aug 30, 2005
    #1
    1. Advertising

  2. Roedy Green Guest

    On 30 Aug 2005 13:26:38 -0700, wrote or quoted :

    >Yes, it is simple JFileChooser instance... I'm using JDK 1_5, Swing in
    >a XP Pro machine and the only thing that I can remember that have been
    >changed in my environment was a Windows Update.


    I suppose you can change the LAF to a less buggy one.

    See http://mindprod.com/jgloss/laf.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Aug 31, 2005
    #2
    1. Advertising

  3. Roedy Green Guest

    On Wed, 31 Aug 2005 00:47:00 GMT, Roedy Green
    <> wrote or quoted :

    >I suppose you can change the LAF to a less buggy one.
    >
    >See http://mindprod.com/jgloss/laf.html


    At least that will prove your conjecture the LAF is at fault.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Aug 31, 2005
    #3
  4. Joan Guest

    <> wrote in message
    news:...
    > Hi,
    >
    > I getting a NumberFormatException executing the following code:
    >
    > JFileChooser fc = new JFileChooser();
    >
    > The following line is called in my code in
    > ...
    > ReadFileFrame.<init>() line: 23
    > ...
    >
    > Yes, it is simple JFileChooser instance... I'm using JDK 1_5,
    > Swing in


    Not "simple" you are using file system view. Simple is without
    file system view.
    Try that just to see if you get further along before an
    exception.


    > a XP Pro machine and the only thing that I can remember that
    > have been
    > changed in my environment was a Windows Update.
    >
    > Based in the stack, I believe that something is broken in the
    > way that
    > Java is getting some Windows UI data.
    >
    > The stack:
    >
    > Thread [AWT-EventQueue-0] (Suspended (exception
    > NumberFormatException))
    > Integer.parseInt(String, int) line: 447
    > Integer.parseInt(String) line: 497
    > Win32ShellFolderManager2.get(String) line: 234
    > ShellFolder.get(String) line: 221
    > WindowsLookAndFeel$LazyWindowsIcon.createValue(UIDefaults)
    > line: 1876
    > UIDefaults.getFromHashtable(Object) line: 183
    > UIDefaults.get(Object) line: 128
    > MultiUIDefaults.get(Object) line: 44
    > MultiUIDefaults(UIDefaults).getIcon(Object) line: 409
    > UIManager.getIcon(Object) line: 613
    > WindowsFileChooserUI(BasicFileChooserUI).installIcons(JFileChooser)
    > line: 237
    > WindowsFileChooserUI(BasicFileChooserUI).installDefaults(JFileChooser)
    > line: 219
    > WindowsFileChooserUI(BasicFileChooserUI).installUI(JComponent)
    > line:
    > 135
    > WindowsFileChooserUI.installUI(JComponent) line: 140
    > JFileChooser(JComponent).setUI(ComponentUI) line: 650
    > JFileChooser.updateUI() line: 1755
    > JFileChooser.setup(FileSystemView) line: 366
    > JFileChooser.<init>(File, FileSystemView) line: 332
    > JFileChooser.<init>() line: 285
    > ReadFileFrame.<init>() line: 23
    > DecAid.readFile() line: 1086
    > DecAid.access$1(DecAid) line: 1059
    > DecAid$ActionListenerAdapter.actionPerformed(ActionEvent) line:
    > 2532
    > JMenuItem(AbstractButton).fireActionPerformed(ActionEvent)
    > line: 1849
    > AbstractButton$Handler.actionPerformed(ActionEvent) line: 2169
    > DefaultButtonModel.fireActionPerformed(ActionEvent) line: 420
    > DefaultButtonModel.setPressed(boolean) line: 258
    > JMenuItem(AbstractButton).doClick(int) line: 302
    > WindowsMenuItemUI(BasicMenuItemUI).doClick(MenuSelectionManager)
    > line:
    > 1000
    > BasicMenuItemUI$Handler.mouseReleased(MouseEvent) line: 1041
    > JMenuItem(Component).processMouseEvent(MouseEvent) line: 5488
    > JMenuItem(JComponent).processMouseEvent(MouseEvent) line: 3093
    > JMenuItem(Component).processEvent(AWTEvent) line: 5253
    > JMenuItem(Container).processEvent(AWTEvent) line: 1966
    > JMenuItem(Component).dispatchEventImpl(AWTEvent) line: 3955
    > JMenuItem(Container).dispatchEventImpl(AWTEvent) line: 2024
    > JMenuItem(Component).dispatchEvent(AWTEvent) line: 3803
    > LightweightDispatcher.retargetMouseEvent(Component, int,
    > MouseEvent)
    > line: 4212
    > LightweightDispatcher.processMouseEvent(MouseEvent) line: 3892
    > LightweightDispatcher.dispatchEvent(AWTEvent) line: 3822
    > JFrame(Container).dispatchEventImpl(AWTEvent) line: 2010
    > JFrame(Window).dispatchEventImpl(AWTEvent) line: 1766
    > JFrame(Component).dispatchEvent(AWTEvent) line: 3803
    > EventQueue.dispatchEvent(AWTEvent) line: 463
    > EventDispatchThread.pumpOneEventForHierarchy(int, Component)
    > line: 234
    > EventDispatchThread.pumpEventsForHierarchy(int, Conditional,
    > Component) line: 163
    > EventDispatchThread.pumpEvents(int, Conditional) line: 157
    > EventDispatchThread.pumpEvents(Conditional) line: 149
    > EventDispatchThread.run() line: 110
    >
     
    Joan, Aug 31, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Brown
    Replies:
    0
    Views:
    988
    Bob Brown
    Jul 1, 2003
  2. June Moore
    Replies:
    3
    Views:
    28,859
    Arild Skaar
    Feb 25, 2004
  3. morc

    NumberFormatException

    morc, Mar 2, 2006, in forum: Java
    Replies:
    11
    Views:
    849
    JPractitioner
    Mar 3, 2006
  4. gbattine
    Replies:
    4
    Views:
    3,234
    Rhino
    May 23, 2006
  5. gbattine
    Replies:
    2
    Views:
    16,017
    Thomas Weidenfeller
    May 30, 2006
Loading...

Share This Page