日期:2014-05-17  浏览次数:20915 次

页面树形目录的显示 急急急!!
本帖最后由 YiFenXiaoAiLian 于 2012-12-26 14:07:36 编辑

举个例子:2001年我想让长期里只显示 办公室 其他办公室2、3、4不显示因为没数据 短期整个不显示  永久只显示有数据的 办公室2 其他的也不显示  代码如下
void getTree(DefaultMutableTreeNode node, int i,Connection con) {
    Querydata qd = new Querydata();
    if (i < jList1Data.size()) {
      String fieldlx=qd.string2("select 字段类型 from TB_fieldsinfo where 字段名称='"+jList1Data.get(i)+"' and 表名='"+frmain.tAbleName+"'",con);
='"+jList1Data.get(i)+"' and 表名='"+frmain.tAbleName+"'");
      String[] field =null;
      if("日期型".equals(fieldlx)){
        field = qd.RsToDataDefault1("select distinct " +  jList1Data.get(i) + " from ["+frmain.tAbleName+"] where 鉴定状态 not in ('暂时删除','已注销') ",con);
      }else{
        field = qd.RsToStringDefault1("select distinct " +  jList1Data.get(i) + " from ["+frmain.tAbleName+"] where 鉴定状态 not in ('暂时删除','已注销') order by "+jList1Data.get(i),con);
      }
      for (int j = 0; j < field.length; j++) {
        DefaultMutableTreeNode node1 = new DefaultMutableTreeNode(field[j]);
        node.add(node1);
        nodeCount++;
        getTree(node1, i,con);
      }
    }
    else if (i >= jList1Data.size()) {
      i = 0;
      return;
    }
  }
我该怎么写  要具体代码  谢谢各位  

------解决方案--------------------
没有帮忙的。。。