The best teams have no specialists, only general contributors with special skills
The best teams have no specialists, only general contributors with special skills
public String getToolTipText(MouseEvent me)
{
int row = getRowForLocation(me.getX(), me.getY());
if(row == - 1){
return super.getToolTipText(me);
}
DefaultMutableTreeNode node = (DefaultMutableTreeNode) getPathForRow(row).getLastPathComponent();
// do whatever with it's child nodes or with it's user object
return toolTip;
}
The best teams have no specialists, only general contributors with special skills
The best teams have no specialists, only general contributors with special skills
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Implementation Note: This class overrides validate, revalidate, repaint, and firePropertyChange solely to improve performance.
If not overridden, these frequently called methods would execute code paths that are unnecessary for the default tree cell renderer. If you write your own renderer, take care to weigh the benefits and drawbacks of overriding these methods.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Originally posted by Nathan Pruett:
I'm running JDK1.4.1_01 on a Windows 2000 box here at work...
Running the RepaintTree code I supplied above doesn't show an overabundance of repaint calls, except in the selection/deselection bit I mentioned above...
When you talk about repainting "all the time" what is going on? I don't get a repaint call just from moving my mouse over the tree... perhaps it had more to do with the ToolTip code???
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |