About: creating rows in a render....
#1
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
Reply
#2
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

hth
tinyMediaManager - THE media manager of your choice - available for Windows, Mac OSX and Linux
Help us translate tinyMediaManager Weblate
Image
Reply
#3
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?)
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
About: creating rows in a render....00