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

JFileChooser details view chops off text

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.1
    • 1.4.0
    • client-libs
    • hopper
    • generic
    • generic



      Name: jk109818 Date: 12/10/2001


      java version "1.4.0-beta3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
      Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)

      The JFileChooser details view does not consider the font size in
      determining row height, for both Metal and Windows L&Fs. For large
      fonts, the text will be chopped off and unreadable. On my system,
      the top of the file icon is chopped off at any font size.
      Example code follows.


         import javax.swing.*;
         import java.util.Enumeration;
         import java.awt.Font;
         import javax.swing.plaf.FontUIResource;

         public class JFileChooserBug {
         
            public static void main(String args[]) {
               setFonts();
               JFileChooser fc = new JFileChooser();
               fc.showOpenDialog(null);
            }
         
            public static void setFonts() {
               UIDefaults defaults = UIManager.getDefaults();
               Enumeration keys = defaults.keys();
               while(keys.hasMoreElements()) {
                  Object key = keys.nextElement();
                  if(defaults.get(key) instanceof Font)
                     UIManager.put(key, new FontUIResource(new Font("Courier",
      Font.BOLD, 30)));
               }
            }
         }
      (Review ID: 136635)
      ======================================================================

            kereminsunw Konstantin Eremin (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: