Duplicate :
|
Name: vi73552 Date: 04/28/99 For the Windows L&F(and possibly the Metal one, depending on what platform it wants to imitate) the file returned back from the getSelectedFile() call is returning what is entered in the JTextField instead of using what is selected in the JList. If you look at how the native chooser does it in Windows you'll see that it always uses what is selected in the listbox. Try going into Notepad or WordPad and use the "Open..." chooser. Select a file from the list, then click in the textfield and change the name, then use Shift-Tab to force the selection back into the the listbox. Now the selected item in the listbox is different from what is entered into the textfield. Clicking "Open" button will open the file selected in the listbox, and NOT the one you have in the textfield. This is the behavior that the JFileChooser should be providing. To see the problem just use the SwingSet demo. java version "1.2" Classic VM (build JDK-1.2-V, native threads) java full version "JDK-1.2-V" (Review ID: 57267) ======================================================================