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

Selected row in a JTable with Intercell Spacing set draws incorrectly

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0_03"
      Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
      Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      If you have a multicolumn JTable and with intercell spacing on it highlighting is not drawn within the intercell spacing. The highlighting doesn't extend to the edge of the cell and rather than a continuous highlighted line you instead get a patchwork effect.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a table,
      setIntercellSpacing on it,
      select a row

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The highlighting should entirely fill all the cell area and extend unbroken from left to right
      ACTUAL -
      The highlighting only fills the components clipping region. The highlighting doesn't fill the entire cell.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Dimension;
      import javax.swing.JFrame;
      import javax.swing.JTable;


      public class TableDemo {
      public static void main(String args[]) {
      JTable table = new JTable(4, 8);
      table.setIntercellSpacing(new Dimension(9,4));
      JFrame frame = new JFrame("Select a row, see how bad it looks"); //$NON-NLS-1$
      frame.setContentPane(table);
      frame.pack();
      frame.setVisible(true);
      }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      Don't use intercell spacing

        Attachments

          Activity

            People

            • Assignee:
              peterz Peter Zhelezniakov
              Reporter:
              ndcosta Nelson Dcosta (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: