Kodi Community Forum

Full Version: About: creating rows in a render....
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to go to my real job soon so I might as well just ask...

It seems, looking at the renderers, that every element in the row is instanced and values applied later. It seems a bit ridiculous to be instancing both a MovieSet row & Movie row every time any row is created within MovieSetTreeCellRenderer. Are these instances being copied somewhere in getTreeCellRendererComponent() before values are applied?

(Note: I'm not looking to rewrite the backend, lol. Wink Just like to understand what my code will do before writing it. )

THX Big Grin
no, the MovieSetTreeCellRenderer is only created once and is being used for every Movie/MovieSet in the JTree. For the JTree the components used in the getTreeCellRendererComponent can be re-used; just filled with the new content

No, it's just "JTrees" are vary helper-object heavy...

Ok, so the components (or more accurately their "state") do not persist after they are drawn to the panel -because-, once they are drawn, the components are no longer needed for the UI.

If true, then I've been working in PHP/HTM for too long Tongue. ...Gosh, then how can the listeners work? (Or can't listeners work on these re-usable components?)