TreeSearchable is an concrete implementation of Searchable
that enables the search function in JTree.
It's very simple to use it. Assuming you have a JTree, all you need to do is to
call
JTree tree = ....;
TreeSearchable searchable = new TreeSearchable(tree);
Now the JTree will have the search function.
There is very little customization you need to do to TreeSearchable. The only thing you might
need is when the element in the JTree needs a special conversion to convert to string. If so, you can overide
convertElementToString() to provide you own algorithm to do the conversion.
JTree tree = ....;
TreeSearchable searchable = new TreeSearchable(tree) {
protected String convertElementToString(Object object) {
...
}
};
Additional customization can be done on the base Searchable class such as background and foreground color, keystrokes,
case sensitivity,
TreeSearchableis an concrete implementation of Searchable that enables the search function in JTree.It's very simple to use it. Assuming you have a JTree, all you need to do is to call
There is very little customization you need to do to TreeSearchable. The only thing you might need is when the element in the JTree needs a special conversion to convert to string. If so, you can overide convertElementToString() to provide you own algorithm to do the conversion.Now the JTree will have the search function.Additional customization can be done on the base Searchable class such as background and foreground color, keystrokes, case sensitivity,JTree tree = ....; TreeSearchable searchable = new TreeSearchable(tree) { protected String convertElementToString(Object object) { ... } };