This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, I have written my own custom tree model. I create the JTree and pass the model as parameter then show the JTree in a scrollpane. There is a button to repopulate the tree model. My question is when I hit this the model is repopulated, but the UI does not reflect the changes even after calling revalidate. What is the best way to detect the changes and update the JTree/UI properly when the whole tree model (except the root node) is regenerated? Should I be firing some sort of event from the tree model after it's regenerated or something? Thanks for the assistance. Rich.
Richard, At what point in your code are you calling the validate( ) method? Also, which components validate( ) method are you calling? Maybe post a little code in a reply so we can see what you're doing easier. Cheers, Andy. "I Code, Therefore I Am"
Joined: Mar 30, 2002
okay sure, this will be very trimmed down from the actual code. The abstract view is just a fancy JPanel that does various other interesting things I use in my application framework, I just call revalidate on it: