O exemplo deste artigo informa ao Windows Resource Manager implementado pelo Java. Compartilhe para todos para sua referência. Os detalhes são os seguintes:
O arquivo fileTree.java é o seguinte:
// fileTree.java/************************************************ *** ****************** Autor: Jason*E -mail: [email protected]*sdn blog: http://blog.csdn.net/unagain/ ** **************************** ************************ ***************************** **/pacote tl.exercise.swing; Java.util.Vector; .Swing.Event.TreeSelectionListener; Public filetree (lista de fileiras) {{thelist = list; } public void FirevaluChangeed (TreeSelectionEvent TSE) {Treepath TP = TSE.GETNEWLEADSELECTION (); FiretreeCollApsed (Treepath Path) {super.firetrecollapsed (Path); "O caminho expandirá" + caminho);} public void FiretreeWillCollapse (caminho Treepath) {System.out.println ("O caminho do caminho será" + caminho); {árvore = ft;} public void TreecollApsed (TreeExpansionEvent Tee) {} public void TreexPanded (TreeeexPansionEvent Tee) {}}} ClassySyStemModel implementa TreEmodel {i_filesystem; Eroot = fs;} public Object getRoot () {return thermoot;} public object getChild (objeto pai, int index) {return (i_filesystem) nt) .getChild (fileType, index);} public int getChildCount (objeto parent) {return (i_filesystem ) Pai) .getChildCount (FileType);} public boolean isleaf (nó objeto) {return ((i_filesystem) .isleaf (tipo fileaf);} public int getIndexofchild (objeto pai, objeto filho) {return ((i_filesystem) pai). GetIndexofChild (FileType, criança);} public void valueForpathChanged (caminho Treepath, objeto newvalue) {} public voi d addreemodellistener (TreemodEllistener l) {} public void removetreemodelllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllLeRy) {}) Public RemoveTreemEmodellllllLlistener (Finaltem) D '; (CHAR Filetype); Objetos do subdiretório e, em seguida, agora, não existe * qualquer meta p> * ie woon'tore arearestent para resolver isso. ; paramsshow */ public void Setshiden (boolen w) {ShowHiden = ifshow;} Ícone público geticon () () retorna fsview.getsystemicon (thefile);} public string tostring () {// return fsview );} / ** * Crie um nó raiz. ; ]); Char fileType, int index) {if (i_filesystem.directory == filetype) {retorna new Foldernode (pasta.get.get (index)); Filetype) {return null;} else {return null;} public int getChildCount (char fileType) {if (i_filesystem.di reitor == fileType) {return paster.size ();} else if (i_filesystem.all == filetype) {Return all.size ();} else if (i_filesystem.file == fileType) {return -1;} else {return -1;} public bo olean isleaf (char fileType) {if (i_filesystem.directory == fileType) {Return paster.size () == 0;} else if (i_filesystem.all == filetype) {return all.size () == 0;} else if (i_filesystem.file = = filetype) {return true;} else {Return true;} public int getIndexofChild (char fileType, object Child) {if (Child Instanceof FolderNode) {if (i_filesystem.directory == FileType) {return paster.indexOf (pastNode) Child) .Thefile);} mais if (i_filesystem.all == FileType) {return all.indexof em.file == FileType) {return -1;} else {retarn -1;}} else {return -1;}} class FoldRerenderRerends DefaultTerEreRer {private Static final Componente público Long U. );
Espera -se que este artigo seja útil para o design do programa Java de todos.