invokeLater with JTreeTable == event-dispatch thread?

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
 
Z

zero

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top