java - Appropriate listener for Swing JTree -


i have jtree, , based on selection want button enabled, have used treeselectionlistener :

tree.addteeselectionlistener(new treeselectionlistener() {     @override     public void valuechanged(treeselectionevent event)     {         okbutton.setenabled(true);     }  }); 

the button getting enabled bit late second or two. problem here?

am using correct listener?


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -