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·½·¨
*/
}
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
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[ ......
package cf.java.study.java.io;
import java.io.File;
import java.io.FileInputStream;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class FileTests {
@Before
public void set ......
Èí¼þ¿ª·¢Ö®Â·ÊdzäÂú¾£¼¬ÓëÌôս֮·,Ò²ÊdzäÂúÏ£Íû֮·¡£JavaѧϰҲÊÇÈç´Ë£¬Ã»Óнݾ¶¿É×ß¡£ÃÎÏëÏñ¡¶ÌìÁú°Ë²¿¡·ÖÐÐéÖñÒ»Ñù±»ÎÞÑÂ×Óõ®õ¹à¶¥¶øÇáËÉ»ñµÃÒ»¼××Ó¹¦Á¦£¬ÊǺܲ»ÏÖʵµÄ¡£Ã¿ÌìÑöÌì´ó½Ð"ÌìÉñ°¡£¬Çë´Í¸øÎÒÒ»±¾¿û»¨±¦µä°É"£¬Êâ²»Öª¼´Ê¹Äã»ñµÃÁË¿û»¨±¦µä£¬³ýÁËÊÜ×Ô¹¬ÆäÉíÖ®¿àÍ⣬ÄãÒ²²»Ò»¶¨³ÉµÃÁË"¶«·½² ......
·ºÐÍÉùÃ÷¾ÍÊÇ·º·ºµÄÉùÃ÷ÀàÐÍ¡£ÎÒÃÇÓÃÆäËüµÄÓïÑÔ×öÒ»¸ö±È½Ï£º
JavascriptÉùÃ÷±äÁ¿£º var i= 1;var c = ‘char ’
VB ÉùÃ÷±äÁ¿£º dim i=1;dim c=’char’
Perl ÉùÃ÷±äÁ¿£º $i = 1; $c = ‘char’
ÕâЩ½Å±¾ÓïÑÔ£¬ÔÚÉùÃ÷±äÁ¿µÄʱºò£¬¸ù±¾¾Í²»ÏëjavaÄÇÑù»¹µÃÉùÃ÷ÀàÐÍ¡£ËûÃǵÄÀàÐÍÒÑ¾× ......