import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; public class TreeDemo1 { public TreeDemo1() { JFrame f = new JFrame("TreeDemo"); Container contentPane = f.getContentPane(); String[] s1 = {"公司文件","个人信件","私人文件"}; String[] s2 = {"本机磁盘(C:)","本机磁盘(D:)","本机磁盘(E:)"}; String[] s3 = {"奇摩站","职棒消息","网络书店"}; Hashtable hashtable1 = new Hashtable(); Hashtable hashtable2 = new Hashtable(); hashtable1.put("我的公文包",s1); hashtable1.put("我的电脑",s2); hashtable1.put("收藏夹",hashtable2); hashtable2.put("网站列表",s3); JTree tree = new JTree(hashtable1); JScrollPane scrollPane = new JScrollPane(); scrollPane.setViewportView(tree); contentPane.add(scrollPane); f.pack(); f.setVisible(true); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); } public static void main(String args[]) { new TreeDemo1(); } }

全幼儿园最帅 LV1
2024年12月18日
azzzz1 LV2
2024年6月26日
fan2019 LV3
2024年1月12日
yangxb2 LV10
2023年10月20日
微信网友_6639502556778496 LV1
2023年9月7日
微信网友_6292282163859456 LV4
2023年1月5日
你们的代码都是我的了 LV16
2022年12月14日
wadadd LV7
2022年9月4日
annunx LV1
2022年4月15日
微信网友_5852742079762432 LV6
2022年3月5日

pxqtsht LV16
2月21日
全幼儿园最帅 LV1
2024年12月18日
rain112 LV31
2024年11月13日
azzzz1 LV2
2024年6月26日
微信网友_7034311029100544
2024年6月12日
暂无贡献等级
20201202038
2024年3月27日
暂无贡献等级
晨爽明宇 LV1
2024年3月4日
Gin19960217 LV4
2024年1月15日
fan2019 LV3
2024年1月12日
1053001914 LV1
2023年12月28日