publicstaticListpanelItemList=newArrayList();static{
ListPanelItem panelItem=null;
panelItem=newListPanelItem();
panelItem.setName("我的电脑");
File[] roots=File.listRoots();
ItemStruct[] itemStructs=newItemStruct[roots.length+3];for(inti=0; i
String totalSpace=calculateSpace(roots[i].getTotalSpace());
String usableSpace=calculateSpace(roots[i].getUsableSpace());
String name=roots[i].toString().replace("\\","");
itemStructs[i]=newItemStruct( name+"盘 ("+usableSpace+")"+totalSpace,"explorer.exe"+roots[i].toString());
}//windows命令行代码,需要其它的话,自行搜索下window命令行命令。itemStructs[roots.length ]=newItemStruct("网上邻居","explorer.exe ::{208D2C60-3AEA-1069-A2D7-08002B30309D}");
itemStructs[roots.length+1]=newItemStruct("回收站","explorer.exe ::{645FF040-5081-101B-9F08-00AA002F954E}");
itemStructs[roots.length+2]=newItemStruct("记事本","notepad");
panelItem.setItems(itemStructs);
panelItemList.add(panelItem);
panelItem=newListPanelItem();
panelItem.setName("关机管理");
panelItem.setItems(newItemStruct[]
{newItemStruct("关机","Shutdown.exe -s -t 00"),newItemStruct("重启","Shutdown.exe -r -f -t 00"),newItemStruct("取消关机","shutdown -a")
}
);
panelItemList.add(panelItem);
panelItem=newListPanelItem();
panelItem.setName("应用程序");
panelItem.setItems(newItemStruct[]
{//这个是我本机的Tomcat安装位置newItemStruct("启动Tomcat","cmd /c E:\\project\\server\\bin\\startup.bat","E:\\project\\server\\bin"),
}
);
panelItemList.add(panelItem);
}