what DEFAULT means for JTable renderers

1) The “default” in getDefaultRenderer() means “class-based”. In each jtable, there’s at most ONE class-based renderer for each class. However, multiple classes (say Price column in double, and Qty column in integer) can share the same class-based renderer.

2) The “default” in DefaultTableCellRenderer.java doesn’t mean “class-based”. It means …. “render for all classes”, kind of render of last resort (Sounds like lender of last resort:)

1b) myjtable.getDefaultRenderer(Object.class) would normally return an instance of DefaultTableCellRenderer.java. This call looks up the class-based renderer for Object.java — the last-resort class-based renderer, which is typically DefaultTableCellRenderer.java.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s