treePanel json javaºǫ́
function createTreeMenu(){//´´½¨Ò»¸öÊ÷µÄÃæ°å
var treeMenu = new Ext.tree.TreePanel({
lines : true,
minSize : 150,
border : false,
root : new Ext.tree.AsyncTreeNode({text : 'root'}),
loader : new Ext.tree.TreeLoader({dataUrl:'/extDemo/getData?action=treeMenu'})
});
var win = new Ext.Window({
width : 600,
height : 400,
items : [treeMenu]
});
treeMenu.expandAll();
win.show();
}
loaderÖеÄdataurl¶ÔÓ¦servletÖе÷ÓÃÒ»¸öÉú³ÉJsonµÄ·½·¨ÈçÏ£º
private String getTreeMenu(){
List<Menu> list = new ArrayList<Menu>();
for (int i = 0; i < 3; i++){
Menu menu = new Menu();
menu.setUrl(null);
menu.setId("id_" + i);
menu.setText("²Ëµ¥" + i);
menu.setLeaf(false);
for (int j = 0; j < 3; j++){
Menu subMenu = new Menu();
subMenu.setUrl("/extDemo/getData");
subMenu.setId(i + "" + j);
subMenu.setText("×Ӳ˵¥" + j);
subMenu.setLeaf(true);
menu.appendChild(subMenu);
}
list.add(menu);
}
return JSONArray.fromObject(list).toString();
}
getTreeMenuÖеÄMenu´úÂëÈçÏ£º
public class Menu {
//ÒÔÏÂ×ֶεÄÃû×ÖÒ»¶¨ÒªÊÇÕâÑù£¬ÒòΪËüÃÇÒª¸úextÖеÄtreeNodeµÄÊôÐÔ¶ÔÓ¦.
private String id;
private String text;
private String url;
private boolean leaf;
private List<Menu> children = new ArrayList<Menu>();
public void appendChild(Menu subMenu){
this.children.add(subMenu);
}
/**»¹ÓкܶàgetºÍset·½·¨
*/
}
Ïà¹ØÎĵµ£º
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
public class ShuffleTest {
public static void main(String args[]) {
String simpsons[ ......
Ò»¡¢¹¦ÄÜ
1¡¢×Ö·û´®µÄÆ¥Åä
2¡¢×Ö·û´®µÄ²éÕÒ
3¡¢×Ö·û´®µÄÌæ»»
¶þ¡¢JavaÖÐÉæ¼°µÄÀà
java.lang.StringÀà¡¢java.util.regex.MatcherÀà¡¢java.util.regex.PatternÀà
Èý¡¢³õ²½Á˽â
& ......
Èí»Ø³µ£¨Soft Return£©£ºÈí»Ø³µÊÇÔÚ×Ö´¦Àí³ÌÐòÖÐ×÷Ϊ×Ô¶¯ÒÆÐй¦ÄܵÄÒ»²¿·Ö×Ô¶¯²åÈëµÄ£¬Ò²½Ð»»Ðзû£¬ÔÚwordÖп´²»¼û¡£Èç¹ûÎı¾
Ò»Ðеij¤¶È³¬¹ýÎĵµËù¶¨ÒåµÄÓұ߾àʱ£¬¼´µ±Ç°ÐÐûÓÐ×ã¹»µÄ¿Õ¼ä·ÅÖÃÏÂÒ»¸ö×Ö·ûʱ£¬ÎÄ×Ö´¦ÀíÈí¼þ½«ÔÚÕâÒ»ÐÐÎı¾µÄĩβ×Ô¶¯²åÈëÒ»
¸öÈí»Ø³µ·û£¬Îı¾ÁíÆðÒ»ÐС£Õâ¸öÈí»Ø³µ·ûÊÇÓɱ༳ÌÐò×Ô¶¯² ......
×î½ü×ö¸öÏîÄ¿£¬¾ÍÊÇҪȡµÃcpuÕ¼ÓÐÂʵȵȵÄϵͳÐÅÏ¢£¬Ò»¿ªÊ¼ÒÔΪҪÓö¯Ì¬Á´½Ó¿âÁË£¬µ«ºóÀ´·¢ÏÖ¿ÉÒÔÏñÏÂÃæÕâÑù×ö£¬²»È¥µ÷ÓÃjni£¬ÕâÑùÊ¡È¥Á˺ܶ࿴м¼ÊõµÄʱ¼äo(∩_∩)o...
ÔÚJavaÖУ¬¿ÉÒÔ»ñµÃ×ܵÄÎïÀíÄڴ桢ʣÓàµÄÎïÀíÄÚ´æ¡¢ÒÑʹÓõÄÎïÀíÄÚ´æµÈÐÅÏ¢£¬ÏÂÃæÀý×Ó¿ÉÒÔÈ¡µÃÕâЩÐÅÏ¢£¬²¢ÇÒ»ñµÃÔÚWindowsϵÄÄÚ´æʹÓà......
»ñÈ¡classÀà·½·¨£º
1£¬getClass 2£¬Class.forName() 3,ÓÃ.class
public Field[] getDeclaredFields()
·µ»ØµÄÊÇij¸öÀàÀïµÄËùÓÐÀàÐ͵ıäÁ¿£¬²»°üÀ¨¼Ì³Ð¸¸ÀàµÄ
public Field[] getDeclaredFields(String name)
·µ»ØÌض¨Ãû×Ö
public Field[] getFields()
·µ»ØµÄÊÇij¸öÀàÀïµÄËùÓÐpublicÀàÐ͵ıäÁ¿£¬°üÀ¨¼Ì³Ð¸¸Àൠ......