• Post Reply Bookmark Topic Watch Topic
  • New Topic

Repopulating Trees and comboboxes  RSS feed

 
NIKHIL EROS
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m using a JTree and JComboBox in my code. I want everytime a user makes a certain selection in checkboxes, the tree component and comboxbox component should be REPOPULATED.
for creating new node structure for JTree and String[] for ComboBox my code is ready.
can anybody please help me how should i take care of REPAINTING OR REVALIDATING OR RELOADING the JTree and JComboBox Components, everytime i want to REPOPULATE them??
thanks in advance
[This message has been edited by NIKHIL EROS (edited October 10, 2001).]
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nikhil,
I am unaware of the need to repopulate a JComboBox. When you add or remove items from the DefaultComboBoxModel the JComboBox will adjust the displayed items. At least that's the way I thought it works. I have never done it myself though ...
For a JTree, you just adjust the TreeModel and when you are done you just call the TreeModel method: reload(). The JTree will then contain the new contents of the TreeModel.
Regards,
Manfred.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!