Insubstantial / insubstantial

Swing look-and-feel library and assorted widgets
193 stars 57 forks source link

JTable rendering component #63

Closed PirolA closed 12 years ago

PirolA commented 12 years ago

When trying to open a Ui with a JTable i got the following error:

java.lang.IllegalArgumentException: Renderer extends the SubstanceDefaultTableCellRenderer but does not return one in its getTableCellRendererComponent() method

The method getTableCellRenderComponent () returns in my case an extended JLabel. The restriction that this method must return a component that extends a SubstanceDefaultTableCellRenderer is counter-productive to my cause. In Substance 6.0 this restriction is not been there, how can I help here?

shemnon commented 12 years ago

Why does your renderer extend SubstanceDefaultTableCellRenderer? Could it extend DefaultTableCellRenderer instead? And why can't the returned JLabel extend SubstanceDefaultTableCellRenderer? Or a renderer that merely wraps the JLabel? Kirill put that exception in before I started maintaining it, and I am lothe to remove something I don't fully understand the reasons for. Unless a good reason for needing to mix the source and the result, I am inclined to pass on this issue.

PirolA commented 12 years ago

The renderer implements SubstanceDefaultTableCellRenderer to get its behaviour. When my JLabel extends SubstanceDefaultTableCellRenderer the table slows down, when changing the selected row it needs much more time (3 sec before 100 msec). I have no explanation for why the table is a lot slower, maybe you can help here?

shemnon commented 12 years ago

Add a system property "insubstantial.looseTableCellRenderers" set to "True" to disable this exception.