Exception NumberFormatException when creating an instance of JFileChooser  
Author Message
noreic





PostPosted: 2005-8-31 4:27:00 Top

java-programmer, Exception NumberFormatException when creating an instance of JFileChooser 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

 
Roedy Green





PostPosted: 2005-8-31 8:47:00 Top

java-programmer >> Exception NumberFormatException when creating an instance of JFileChooser On 30 Aug 2005 13:26:38 -0700, email***@***.com 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





PostPosted: 2005-8-31 11:25:00 Top

java-programmer >> Exception NumberFormatException when creating an instance of JFileChooser On Wed, 31 Aug 2005 00:47:00 GMT, Roedy Green
<email***@***.com> 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.
 
 
Joan





PostPosted: 2005-8-31 12:09:00 Top

java-programmer >> Exception NumberFormatException when creating an instance of JFileChooser
<email***@***.com> wrote in message
news:email***@***.com...
> 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
>