这段代码好象没起作用?

sgdb 2003-04-28 04:11:18
TreFileList.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e)
{
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
if(selState){
TreePath path=TreFileList.getSelectionPath();
DefaultMutableTreeNode node=(DefaultMutableTreeNode)path.getLastPathComponent();
if(node.isLeaf()){
String selFile="";
String strPath=path.toString();
strPath=strPath.replace('[',' ');
strPath=strPath.replace(']',' ');
for(int i=1;i<=path.getPathCount()-1;i++){
int c=strPath.lastIndexOf(",");
selFile=strPath.substring(c+1).trim()+"\\"+selFile;
strPath=strPath.substring(0,c);
}
selFile=selDriver+selFile.substring(0,selFile.length()-1).trim();
loadPic(selFile);
}
}
}
});
TreFileList是jtree类对象
当我点击TreFileList里的叶节点时loadPic(selFile);没反应,为什么??
...全文
86 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
sgdb 2003-04-28
  • 打赏
  • 举报
回复
没人回??
up
hellomartin 2003-04-28
  • 打赏
  • 举报
回复
学习!

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧