-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.3.0
-
x86
-
windows_nt
Name: rlT66838 Date: 03/06/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-I)
Java HotSpot(TM) Client VM (build 1.3-I, mixed mode)
I have a JTable with a custom, JButton-based,
TableCellRenderer that I use for the column headers
of my table. I allow the table to be sorted by column
and each column can be sorted in two directions. In
order to show the current direction of the sort on a
column, I show an up or down arrow in my column header
(if you look at Netscape's Messenger, you get the idea
that I'm trying to emulate.) My TableCellRenderer
extends JButton and has the required method
getTableCellRendererComponent() that gets called to
draw each column header. In this method, I make a call
to super.setIcon() to either set the icon to NULL (for
those columns that are not being sorted on) or to the
up- or down-arrow icons for the currently selected
column. Everything works well - EXCEPT that occasionally
the icon doesn't get updated with the right one! I
verified that it's a refresh problem by simply dragging
another window over the column header - when I move the
window away, the icon is updated to the appropriate one.
I tried including a call to paintImmediately() to get
the icon update to take place in a more timely manner,
but that doesn't seem to help at all.
I have not verified whether this problem is with all
JButton's or only those that are being used as a
TableCellRenderer (where the setIcon() method is called
alot)
Test Case: See attached Tar file
(Review ID: 99995)
======================================================================