Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Rep Power

    Question JTable Cell Merge Highlighting and Redrawing Issue

    I have been working on getting cell merging to work with a JTable, and in order to do this I have had to rewrite all of BasicTableUI using its source code as a template. I have also needed to override the getCellRect method of JTable, and have created a custom CellRenderer. With that being said, the problem I have run into is that when I merge a group of cells together everything works until I go to highlight an area around that group of cells. When I do this the area that would have been highlighted had no cells been merged is cleared everywhere within that cell merger. That is probably confusing so I have included a few images:

    This is an image of the table with a cell merger:

    And these images are when I highlight some area around the cell merger that include part of the merger within the highlightings bounds (notice how some of the text is erased, this is the problem):

    And it might be worth showing you that everything works fine when the entire cell merger is highlighted:

    I should also mention that when cells are merged, the upper left hand cell take precedence, in other words, that cell is enlarged to the size of the cell merger and the other cells are simply never drawn (I took care of this in BasicTableUI).

    I am presently unsure where to go from here to fix this issue. I was thinking it might have something to do with RepaintManager but I am unsure. If someone could point me in the right direction I would very much appreciate it. If you need any additional information please let me know.

    Thank you for your time,

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power


    Quote Originally Posted by officialhopsof View Post
    If you need any additional information please let me know.
    Hello, and welcome to the Java Forums. I see that you've also posted this same question on JavaRanch. You're new here and probably don't know the forum rules, but we request that you abide by the same rules that JavaRanch has regarding cross-posts. I invite you to read their FAQ on this as it will explain why this is important to them and to us:


    Thank you for your cooperation in this matter, and best of luck.

  3. #3
    Join Date
    May 2008
    Rep Power


    Ah, I will follow this in the future. If i receive an answer at JavaRanch I will post it here as well.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

Similar Threads

  1. jtable cell to string
    By Sno in forum New To Java
    Replies: 3
    Last Post: 04-30-2010, 05:08 PM
  2. Jtable and cell coordinates
    By rattaman in forum AWT / Swing
    Replies: 2
    Last Post: 11-17-2009, 06:48 PM
  3. How to merge cells of JTable
    By nehaa in forum AWT / Swing
    Replies: 1
    Last Post: 05-19-2009, 01:07 PM
  4. how to merge cells /colspan in Jtable
    By ravrajesh.ap in forum AWT / Swing
    Replies: 0
    Last Post: 01-03-2009, 05:25 PM
  5. problem in redrawing JTable
    By abhinav in forum AWT / Swing
    Replies: 0
    Last Post: 11-21-2007, 10:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts