default-default table cell renderer

System.out.println(System.identityHashCode(new JTable().getDefaultRenderer(Object.class)));

System.out.println(System.identityHashCode(new JTable().getDefaultRenderer(Object.class))); // different address

You can see each jtable has a default-default-default render instance. When I say default-default… I mean the renderer for Object.class.

Given this renderer instance is shared by all cells of the jtable, you can customise this instance to control the default appearance of many, many cells. This object is stateful — actually a subclass instance of JLabel.

Advertisements

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