Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why JTable parameter from getTableCellRendererComponent can be null?

user10878887Sep 2 2011 — edited Sep 4 2011
Hello
I have a class that implements TableCellRenderer.
TableCellRender interface has only one method:
getTableCellRendererComponentender (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) 
and this method accepts JTable as null - http://download.oracle.com/javase/1.3/docs/api/javax/swing/table/TableCellRenderer.html.

Why can JTable be null?
When I run my program, in the getTableCellRendererComponentender method I execute
this.size = table.getColumnModel().getColumn(column).getWidth();
But this code is unsuccessfull because table is null.
The table is in fact defined but I don't know why is not passing as parameter to getTableCellRendererComponentender .

Thank you.
This post has been answered by darrylburke on Sep 3 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 2 2011
Added on Sep 2 2011
13 comments
719 views