import javax.swing.tree.*; import javax.swing.event.*; import java.io.*; public class FailipuuMudel implements TreeModel{ public void addTreeModelListener(TreeModelListener l){} public Object getChild(Object kaust, int nr){ return ((File)kaust).listFiles()[nr]; } public int getChildCount(Object kaust){ File[] loetelu=((File)kaust).listFiles(); if(loetelu!=null){ return loetelu.length; } return 0; } public int getIndexOfChild(Object kaust, Object fail){ File[] failid=((File)kaust).listFiles(); for(int i=0; i