Results 1 to 4 of 4
- 12-21-2010, 03:36 AM #1
Member
- Join Date
- May 2008
- Posts
- 8
- Rep Power
- 0
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,
Brandon
-
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:
BeForthrightWhenCrossPostingToOtherSites
Thank you for your cooperation in this matter, and best of luck.
- 12-21-2010, 04:31 AM #3
Member
- Join Date
- May 2008
- Posts
- 8
- Rep Power
- 0
Ah, I will follow this in the future. If i receive an answer at JavaRanch I will post it here as well.
- 12-21-2010, 06:32 AM #4
And don't forget about the Oracle forums
OTN Discussion Forums : JTable Cell Merge Highlighting and ...
db
Similar Threads
-
jtable cell to string
By Sno in forum New To JavaReplies: 3Last Post: 04-30-2010, 05:08 PM -
Jtable and cell coordinates
By rattaman in forum AWT / SwingReplies: 2Last Post: 11-17-2009, 05:48 PM -
How to merge cells of JTable
By nehaa in forum AWT / SwingReplies: 1Last Post: 05-19-2009, 01:07 PM -
how to merge cells /colspan in Jtable
By ravrajesh.ap in forum AWT / SwingReplies: 0Last Post: 01-03-2009, 04:25 PM -
problem in redrawing JTable
By abhinav in forum AWT / SwingReplies: 0Last Post: 11-21-2007, 09:08 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks