United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4843574 GTK+ JFileChooser doesn't open multiple files
JDK-4843574 : GTK+ JFileChooser doesn't open multiple files

Details
Type:
Bug
Submit Date:
2003-04-07
Status:
Resolved
Updated Date:
2003-11-11
Project Name:
JDK
Resolved Date:
2003-11-03
Component:
client-libs
OS:
linux
Sub-Component:
javax.swing
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.2
Fixed Versions:
1.4.2_04 (04)

Related Reports
Backport:

Sub Tasks

Description

Name: rmT116609			Date: 04/06/2003


FULL PRODUCT VERSION :
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)

FULL OS VERSION :
Red Hat Linux 9, kernel 2.4.20, i686
Windows 2000

A DESCRIPTION OF THE PROBLEM :
The JFileChooser does not open multiple files when using the GTK+ look and feel.  Only the first file listed is returned in the array from getSelectedFiles(); the array has length 1.  The Metal look and feel returns an array of all the chosen files.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Choose setMultiSelectioneEnabled(true).
2) Open the JFileChooser.
3) Highlight 2 or more files.
4) Click on the accept button.

EXPECTED VERSUS ACTUAL BEHAVIOR :
All the files will be returned from getSelectedFiles().
Only the first file listed is returned.  getSelectedFiles() returns an array of length 1.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.io.*;

public class GTKJFileChooserTest {

	public static void main(String[] args) {
		try {
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk"
					+ ".GTKLookAndFeel");
		} catch (Exception e) {}
		JFileChooser chooser = new JFileChooser();
		chooser.setMultiSelectionEnabled(true);
		chooser.showOpenDialog(null);
	
		File[] files = chooser.getSelectedFiles();
		System.out.println("Num of files: " + files.length);
		for (int i = 0; i < files.length; i++) {
			System.out.println("File " + i + " " + "path: "
					+ files[i].getPath());
		}
	}
}
---------- END SOURCE ----------

(Review ID: 183630) 
======================================================================

                                    

Comments
EVALUATION

Reproducible as indicated.
###@###.### 2003-04-07


Name: pzR10082			Date: 10/17/2003


GTKFileChooserUI.getFileName() returns just one filename -- one of
the file selected first. It should return a String containing all
file names in quotes, like '"a.txt" "b.txt" "c.txt"'.

###@###.###

======================================================================

Name: pzR10082			Date: 10/21/2003


Method GTKFileChooser.getFileName() will be overridden to return
all files selected in the list plus the name typed into the
text field.

###@###.###

======================================================================
                                     
2004-08-24
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
1.4.2_04
tiger-beta

FIXED IN:
1.4.2_04
tiger-beta

INTEGRATED IN:
1.4.2_04
tiger-b28
tiger-beta


                                     
2004-08-24



Hardware and Software, Engineered to Work Together