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

JTable.getRowHeight() returns value different from the specified default (16.0) with GTK L&F

XMLWordPrintable

    • b109
    • generic
    • linux
    • Verified

      Specification for javax.swing.JTable says:

          /**
           * Returns the height of a table row, in pixels.
           * The default row height is 16.0.
           */
          public int getRowHeight() { ... }

      This is not true for all documented L&Fs. Violated if GTK is used.


      Platform: Linux
      JCK: 6
      JDK: 6, 7
      L&F: -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
      Test: api/javax_swing/JTable/index.html#JTableSortingFiltering[setGetRowSorter2001]

      ---------------------------------------------------------------------------------
      import javax.swing.*;
      public class RowHeight {
          public static void main(String[] args) {
              final JTable jTable = new JTable();
              System.out.println("jTable.getRowHeight() = " + jTable.getRowHeight());
          }
      }
      ---------------------------------------------------------------------------------

      With GTF L&F the output will be

      jTable.getRowHeight() = 18

      Without GTK

      jTable.getRowHeight() = 16
      Spec was updated according to the evaluation, so failing tests need to be removed / updated accordingly.

            malenkov Sergey Malenkov (Inactive)
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: