Hi
The following invokeLater doesn't print the path info in a JTreeTable.
However, if I use Thread.sleep it is able to expand the paths. Please
note that the JTreeTable is created in the main thread. Can someone
please enlighten me about event-dispatcher thread. Thank you
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
public void run() {
Vector pathList = ttsDefaults.getPathList();
int startRow=0;
String prefix="";
TreePath path=null;
for (Enumeration e = pathList.elements();
e.hasMoreElements();) {
startRow = 0;
prefix = (String) e.nextElement();
System.out.println("prefix=***********************" +
prefix);
path = treeTable.getTree().getNextMatch(prefix.trim(),
startRow, javax.swing.text.Position.Bias.Forward);
if (path != null) {
System.out.println("path = ********************" +
path.toString());
}
if (path != null ) {
treeTable.getTree().expandPath(path);
}
}
} //run
}); //invoke
zero - 23 Nov 2005 16:48 GMT
> Hi
> The following invokeLater doesn't print the path info in a JTreeTable.
> However, if I use Thread.sleep it is able to expand the paths. Please
> note that the JTreeTable is created in the main thread. Can someone
> please enlighten me about event-dispatcher thread. Thank you
<ugly layout code snipped>
When you post code please make it readable by changing the tabs into 1 to 3
spaces (depending on how long the lines are). What you posted is just too
hard to read.
Also, for swing specific questions I suggest comp.lang.java.gui or sun's
own forum at http://forums.java.sun.com/index.jspa