This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 197212 - JFileChooser.getSelectedFiles() does not work on JDK 7.0 with GTK l&f
Summary: JFileChooser.getSelectedFiles() does not work on JDK 7.0 with GTK l&f
Status: VERIFIED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: JDK Problems (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-30 06:13 UTC by rcasha
Modified: 2011-06-20 14:24 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of invalid library entry after multiselection of more JARs. (97.18 KB, image/png)
2011-04-05 19:29 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rcasha 2011-03-30 06:13:38 UTC
The Library Manager in 7.0RC1 uses a new kind of dialog to select JARs to add to a library. With this new dialog, selecting multiple files at the same time adds a single invalid line to the library.
Comment 1 Jiri Kovalsky 2011-03-30 12:19:19 UTC
Reassigning for further evaluation.
Comment 2 Tomas Danek 2011-03-30 13:34:27 UTC
Regression means P2
Comment 3 Tomas Danek 2011-03-30 14:22:14 UTC
Unable to reproduce on Ubuntu/JDK 6u24, 7.0 RC1

Please reopen with more details, how we can reproduce.
Comment 4 Tomas Zezula 2011-03-30 14:42:50 UTC
Cannot reproduce on Mac
Comment 5 Jiri Kovalsky 2011-04-05 19:29:39 UTC
Created attachment 107525 [details]
Screenshot of invalid library entry after multiselection of more JARs.
Comment 6 Jiri Kovalsky 2011-04-05 19:30:59 UTC
Please take a look at the attached screenshot. I simply multiselected both activation and mail JAR files and clicked Add JAR/Folder".
Comment 7 Jesse Glick 2011-04-05 19:52:30 UTC
Looks like some sort of nonstandard file chooser UI? Perhaps its JFileChooser UI delegate has a buggy implementation of multiselection.
Comment 8 Jiri Kovalsky 2011-04-05 20:14:15 UTC
Product Version: NetBeans IDE 7.0 RC2 (Build 201103310000)
Java: 1.7.0-ea; Java HotSpot(TM) 64-Bit Server VM 21.0-b02
System: Linux Mint 10 (Julia) - version 2.6.35-22-generic running on amd64; UTF-8; cs_CZ (nb)
Userdir: /home/cesilko/.netbeans/7.0rc2
Comment 9 Jesse Glick 2011-04-05 21:43:28 UTC
So probably a bug in the JDK 7 file chooser. I have a feeling this was filed before.

At any rate, not a P2; workaround is simply to select files individually (admittedly an annoyance when there are a lot of them).
Comment 10 Jiri Kovalsky 2011-04-06 09:37:35 UTC
Agreed. This is JDK 7 specific bug. With JDK 6 Update 23 this does not happen.
Comment 11 Tomas Zezula 2011-04-06 10:10:44 UTC
Tomas M. will check it with JDK 7.0, seems as JDK 7.0 bug
Comment 12 Tomas Danek 2011-04-06 10:17:34 UTC
it's really reproducible on ubuntu jdk7ea.
Comment 13 Tomas Zezula 2011-04-06 13:00:01 UTC
Bug in the JDK 7.0 (GTK look & feel).
Can be tested with simple Java code:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled(false);
chooser.setAcceptAllFileFilterUsed(false);
chooser.setMultiSelectionEnabled (true);
chooser.setDialogTitle("TXT_OpenClasses");
chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
chooser.setApproveButtonText("CTL_SelectCP");
if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
   System.out.println(Arrays.toString(chooser.getSelectedFiles()));;
}


Thanks to tmusil for Linux testing.
Comment 14 Antonin Nebuzelsky 2011-05-31 09:29:21 UTC
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7049934
Comment 15 Antonin Nebuzelsky 2011-06-16 10:55:17 UTC
Tomasi M,

can you verify that the problem is fixed in jdk7 b145? It should be. The short sample code does not manifest the problem with b145 anymore.
Comment 16 Tomas Danek 2011-06-20 14:24:35 UTC
Verified in JDK 7 b145, works properly now.