JDK-4998257 : FileFilters do not work properly with MotifLookAndFeel
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.2_03
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2004-02-20
  • Updated: 2004-03-10
  • Resolved: 2004-03-10
Related Reports
Duplicate :  
Description
When multiple filters are used in a JFileChooser with the MotifLookAndFeel, there are problems with the way the files are displayed.  The attached test case is a modified version of FileChooserDemo2 from the Java Tutorial.  In this example, filters for .alog and .nlog extensions are added to the JFileChooser.

Behavior is different depending on whether or not the directory contains subdirectories, and whether or not files with both .alog and .nlog extensions are present.  If files of both types are present, the problem is not exhibited.
If only one or the other extension type is present, and the directory does contain subdirectories, toggling between the two filters will display no results.  If only one or the other is present, and the directory does not contain subdirectories, toggling between the two filters will always display files with the one extension type.

The problem occurs on both Solaris 9 and Windows XP with the MotifLookAndFeel.  The problem does not exist on either platform with the MetalLookAndFeel.  1.4.2_03 and 1.5.0-beta both exhibit the problem.

Comments
EVALUATION Name: keR10081 Date: 03/10/2004 In fact, almost identical fix has already been implemented in dragon (1.5.1) workspace (version 1.42 of MotifFileChooserUI.java) as a result of fix for bug 4872980. Closing out as a duplicate. ###@###.### ======================================================================
24-08-2004

WORK AROUND Either type in the desired file name, or change to the desired filter type before navigating to the directory.
24-08-2004

SUGGESTED FIX Update: intervanlRemoved needs a the change too. ----- MotifFileChooserUI.java ------- *** //C/tmp/sccs.001000 Wed Mar 3 17:03:08 2004 --- MotifFileChooserUI.java Wed Mar 3 17:03:06 2004 *************** *** 559,568 **** --- 559,570 ---- } public void intervalAdded(ListDataEvent e) { + fireIntervalAdded(e.getSource(), e.getIndex0(), e.getIndex1()); } // PENDING(jeff) - implement public void intervalRemoved(ListDataEvent e) { + fireIntervalRemoved(e.getSource(), e.getIndex0(), e.getIndex1()); } // PENDING(jeff) - this is inefficient - should sent out *************** *** 602,611 **** --- 604,615 ---- } public void intervalAdded(ListDataEvent e) { + fireIntervalAdded(e.getSource(), e.getIndex0(), e.getIndex1()); } // PENDING(jeff) - implement public void intervalRemoved(ListDataEvent e) { + fireIntervalRemoved(e.getSource(), e.getIndex0(), e.getIndex1()); } // PENDING(jeff) - this is inefficient - should sent out ###@###.### 2004-03-23
23-03-2004