• 大小: 0.04M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-01
  • 标签: swing  java  编辑  控件  树形  

资源简介


资源截图

代码片段和文件信息

// -*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
// @homepage@

package example;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.util.Optional;
import javax.swing.*;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;

public final class MainPanel extends JPanel {
  private MainPanel() {
    super(new BorderLayout());
    JTree tree = new JTree();
    tree.setComponentPopupMenu(new TreePopupMenu());
    add(new JScrollPane(tree));
    setPreferredSize(new Dimension(320 240));
  }

  public static void main(String... args) {
    EventQueue.invokeLater(new Runnable() {
      @Override public void run(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       22539  2019-08-23 17:36  build.xml
     目录           0  2019-08-24 08:49  config\
     文件         388  2019-08-23 17:36  config\jnlp.xml
     文件        2145  2019-08-23 17:36  config\properties.xml
     文件         152  2019-08-23 17:36  config.gradle
     文件         526  2019-08-23 17:36  run.bat
     文件         614  2019-08-23 17:36  run.sh
     目录           0  2019-08-24 08:49  src\
     目录           0  2019-08-24 08:49  src\java\
     目录           0  2019-08-24 08:49  src\java\example\
     文件        5341  2019-08-23 17:36  src\java\example\MainPanel.java
     目录           0  2019-08-24 08:49  src\web\
     文件         537  2019-08-23 17:36  src\web\example.jnlp
     文件         341  2019-08-23 17:36  src\web\index.html
     文件        9870  2019-08-23 17:36  src\web\screenshot.png
     目录           0  2019-08-24 17:35  target\
     目录           0  2019-08-24 17:35  target\classes\
     目录           0  2019-08-24 17:35  target\classes\example\
     文件         516  2019-08-24 17:35  target\classes\example\MainPanel$1.class
     文件        2131  2019-08-24 17:35  target\classes\example\MainPanel.class
     文件        1652  2019-08-24 17:35  target\classes\example\TreePopupMenu$1.class
     文件        1630  2019-08-24 17:35  target\classes\example\TreePopupMenu$2.class
     文件         967  2019-08-24 17:35  target\classes\example\TreePopupMenu$3$1$1.class
     文件         902  2019-08-24 17:35  target\classes\example\TreePopupMenu$3$1.class
     文件        3237  2019-08-24 17:35  target\classes\example\TreePopupMenu$3.class
     文件        1397  2019-08-24 17:35  target\classes\example\TreePopupMenu$4.class
     文件        2398  2019-08-24 17:35  target\classes\example\TreePopupMenu.class
     文件         624  2019-08-24 17:35  target\example.jnlp
     文件         473  2019-08-24 17:35  target\index.html
     文件        9870  2019-08-24 17:35  target\screenshot.png
     目录           0  2019-08-24 17:35  target\src\
............此处省略2个文件信息

评论

共有 条评论