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

    Details

    • Subcomponent:
    • Resolved In Build:
      b109
    • CPU:
      generic
    • OS:
      linux
    • Verification:
      Verified

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: