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

Native UI's JTable rendering is wrong on Vista

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.6.0_17"
      Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
      Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.0.6002]

      A DESCRIPTION OF THE PROBLEM :
      The rendering on the native UI on vista is wrong: It shows the remainder of a JTable inside of a JScrollpane as "free space". This means, there are neiter column headers nor table cells rendered at that space of the JScrollPane that is no covered by the JTable. A native ("real") Vista application always renders this space as it would be covered by the table, i. e. the column header is rendered as if there would be an additional column (as an "nameless" header), and the row space is rendered as if there would be blank rows. It is impossible to imitate this behaviour with Java 1.6: To imitate the sizing behaviour, AUTO_RESIZE_OFF *must* get used as this is what native Vista applications do, but this prevents rendering of the blank space. Vice versa, blank space rendering can be imitated using AUTO_RESIZE_LAST plus an additional, always empty column, but this is wrong, since it prevents the automatic display of a scroll bar (what Vista style wants to be like).
      So it is currently impossible to make a GUI that really looks like Vista.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Put a JTable on a JScrollPane, set AUTO_SCROLL_OFF, add some columns. Using the mouse, size the last column to be large or smaller than the JScrollPane.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      When dragging the mouse outside of the JScrollPane, a scroll bar must be shown *and* the last column must be enlarged.

      When minimizing the last column, the scroll bar must hide when the JTable gets smaller than the JScrollPane, *and* the space between the JTable's border and the JScrollPane's border render render as if there would be an additional column (i. e. there must be a blank header but not blank space).
      ACTUAL -
      When dragging the mouse outside of the JScrollPane, a scroll bar occurs and the last column is getting enlarged.

      When minimizing the last column, the scroll bar hides when JTable gets smaller than the JScrollPane, *but* the space between the JTable's border and the JScrollPane's border renders as if there is *no* additional column (i. e. there is *no* blank header but just blank *space*).

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      If you are really unable to set up a JDialog with a JScrollPane and a JTable, poor guy, but write me an email and I will send you the needed five code lines (plus a link to your own Swing tutorial on how to use JTable).
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The is no workaround existing.

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: