S
soup_or_power
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
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