Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8351117

JFileChooser in details view shows wrong column titles and undesired characters

XMLWordPrintable

    • b01
    • 11
    • generic
    • windows_10

      A DESCRIPTION OF THE PROBLEM :
      The JFileChooser shows incorrect column titles or column contents for certain folders in the Details View and unwanted special characters in the values ​​in the date column.
      This can be seen, for example, in your own home folder.
      The column with the title "Size" appears to show the date of the files and folders.
      The column "Modified" appears to show the folder in which the files and folders are located.
      In addition, the UTF special characters U+200E (Left-to-Right Mark (LRM)) and U+200F (Right-to-Left Mark (RLM)) appear in the date values ​​in the table, which leads to an undesirable and difficult to read display.
      The display of these special characters probably depends on the font used in the JFileChooser and is visible, for example, as vertical bars in the Windows L&F, while they are not displayed in the Metal L&F.

      REGRESSION : Last worked in version 8

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Start the test case code, a JFileChooser should open.
      2. Select your own home folder in the "Look in" combo box.
      3. Select the "Details" view using the right element in the toolbar.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The "Size" column should show the size of files.
      The "Modified" column should show the modification date of files and folders.
      The date values ​​in the table should be clearly readable without special characters.
      ACTUAL -
      The "Size" column shows date values ​​that contain the special characters U+200E and U+200F and are difficult to read.
      The "Modified" column shows folder paths.


      ---------- BEGIN SOURCE ----------
      import java.util.Locale;

      import javax.swing.JFileChooser;
      import javax.swing.SwingUtilities;
      import javax.swing.UIManager;

      public class Bug0035298TestCaseCode {

          public static void main(String[] args) throws Exception {
              new Bug0035298TestCaseCode().start();
          }

          public void start() throws Exception {
              SwingUtilities.invokeAndWait(this::startInEDT);
          }

          public void startInEDT() {

              try {
                  Locale.setDefault(Locale.ENGLISH);
                  UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                  JFileChooser fileChooser = new JFileChooser();
                  fileChooser.showDialog(null, "Test");
              } catch (RuntimeException e) {
                  throw e;
              } catch (Throwable t) {
                  throw new RuntimeException(t);
              }
          }
      }

      ---------- END SOURCE ----------

            tr Tejesh R
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: