亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? classtree.java

?? java源碼 java源碼 值得一看 值得一看
?? JAVA
字號:
/**
   @version 1.02 2004-08-21
   @author Cay Horstmann
*/

import java.awt.*;
import java.awt.event.*;
import java.lang.reflect.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;

/**
   This program demonstrates cell rendering by showing
   a tree of classes and their superclasses.
*/
public class ClassTree
{  
   public static void main(String[] args)
   {  
      JFrame frame = new ClassTreeFrame();
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setVisible(true);
   }
}

/**
   This frame displays the class tree, a text field and 
   add button to add more classes into the tree.
*/
class ClassTreeFrame extends JFrame
{  
   public ClassTreeFrame()
   {  
      setTitle("ClassTree");
      setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

      // the root of the class tree is Object
      root = new DefaultMutableTreeNode(java.lang.Object.class);
      model = new DefaultTreeModel(root);
      tree = new JTree(model);

      // add this class to populate the tree with some data
      addClass(getClass());

      // set up node icons
      ClassNameTreeCellRenderer renderer = new ClassNameTreeCellRenderer();
      renderer.setClosedIcon(new ImageIcon("red-ball.gif"));
      renderer.setOpenIcon(new ImageIcon("yellow-ball.gif"));
      renderer.setLeafIcon(new ImageIcon("blue-ball.gif"));
      tree.setCellRenderer(renderer);

      add(new JScrollPane(tree), BorderLayout.CENTER);

      addTextField();
   }

   /**
      Add the text field and "Add" button to add a new class.
   */
   public void addTextField()
   {
      JPanel panel = new JPanel();

      ActionListener addListener = new
         ActionListener()
         {
            public void actionPerformed(ActionEvent event)
            {  
               // add the class whose name is in the text field
               try
               {  
                  String text = textField.getText();
                  addClass(Class.forName(text)); // clear text field to indicate success
                  textField.setText("");
               }
               catch (ClassNotFoundException e)
               {  
                  JOptionPane.showMessageDialog(null, "Class not found");
               }
            }
         };

      // new class names are typed into this text field
      textField = new JTextField(20);
      textField.addActionListener(addListener);
      panel.add(textField);

      JButton addButton = new JButton("Add");
      addButton.addActionListener(addListener);
      panel.add(addButton);

      add(panel, BorderLayout.SOUTH);
   }

   /**
      Finds an object in the tree.
      @param obj the object to find
      @return the node containing the object or null
      if the object is not present in the tree
   */
   public DefaultMutableTreeNode findUserObject(Object obj)
   {  
      // find the node containing a user object
      Enumeration e = root.breadthFirstEnumeration();
      while (e.hasMoreElements())
      {  
         DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.nextElement();
         if (node.getUserObject().equals(obj))
            return node;
      }
      return null;
   }

   /**
      Adds a new class and any parent classes that aren't
      yet part of the tree
      @param c the class to add
      @return the newly added node.
   */
   public DefaultMutableTreeNode addClass(Class c)
   {  
      // add a new class to the tree

      // skip non-class types
      if (c.isInterface() || c.isPrimitive()) return null;

      // if the class is already in the tree, return its node
      DefaultMutableTreeNode node = findUserObject(c);
      if (node != null) return node;

      // class isn't present--first add class parent recursively

      Class s = c.getSuperclass();

      DefaultMutableTreeNode parent;
      if (s == null)
         parent = root;
      else
         parent = addClass(s);

      // add the class as a child to the parent
      DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(c);
      model.insertNodeInto(newNode, parent, parent.getChildCount());

      // make node visible
      TreePath path = new TreePath(model.getPathToRoot(newNode));
      tree.makeVisible(path);

      return newNode;
   }

   private DefaultMutableTreeNode root;
   private DefaultTreeModel model;
   private JTree tree;
   private JTextField textField;
   private static final int DEFAULT_WIDTH = 400;
   private static final int DEFAULT_HEIGHT = 300;
}

/**
   This class renders a class name either in plain or italic.
   Abstract classes are italic.
*/
class ClassNameTreeCellRenderer extends DefaultTreeCellRenderer
{  
   public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, 
      boolean expanded, boolean leaf, int row, boolean hasFocus)
   {  
      super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
      // get the user object
      DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
      Class c = (Class) node.getUserObject();

      // the first time, derive italic font from plain font
      if (plainFont == null)
      {  
         plainFont = getFont();
         // the tree cell renderer is sometimes called with a label that has a null font
         if (plainFont != null) italicFont = plainFont.deriveFont(Font.ITALIC);
      }

      // set font to italic if the class is abstract, plain otherwise
      if ((c.getModifiers() & Modifier.ABSTRACT) == 0)
         setFont(plainFont);
      else
         setFont(italicFont);
      return this;
   }

   private Font plainFont = null;
   private Font italicFont = null;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲欧美色| 免费成人你懂的| 中文字幕av不卡| 国产亚洲欧洲一区高清在线观看| 5858s免费视频成人| 欧美三级视频在线播放| 91视视频在线观看入口直接观看www| 国产精品99久久久久久似苏梦涵| 精品在线播放午夜| 九九精品一区二区| 国产一区二区在线看| 国产一区二区三区香蕉| 极品瑜伽女神91| 国产在线精品一区二区| 国产精品原创巨作av| 国产suv精品一区二区6| 懂色一区二区三区免费观看| 成人影视亚洲图片在线| bt欧美亚洲午夜电影天堂| 97久久超碰国产精品电影| 一本大道综合伊人精品热热| 91麻豆福利精品推荐| 在线观看欧美黄色| 欧美日韩午夜在线| 欧美一级黄色片| 精品国产凹凸成av人网站| 国产日韩av一区| 亚洲丝袜美腿综合| 亚洲电影中文字幕在线观看| 日韩电影在线免费观看| 国产精品一色哟哟哟| 99天天综合性| 欧美伦理影视网| 精品国产在天天线2019| 国产精品灌醉下药二区| 亚洲国产一区二区a毛片| 美女视频一区二区三区| 国产成人在线视频免费播放| 色综合中文字幕国产| 欧美视频在线一区二区三区| 欧美v日韩v国产v| 国产精品美女久久久久aⅴ| 亚洲国产精品影院| 久久9热精品视频| www.综合网.com| 成人午夜视频网站| 在线精品视频免费播放| 欧美日本一道本在线视频| 欧美剧在线免费观看网站 | 色悠悠久久综合| av在线不卡网| 欧美自拍丝袜亚洲| 欧美日本在线视频| 国产精品免费视频观看| 亚洲激情校园春色| 免费观看一级欧美片| 国产高清无密码一区二区三区| www.成人网.com| 欧美性xxxxx极品少妇| 欧美成人精品3d动漫h| 国产欧美精品在线观看| 一区二区三区在线不卡| 麻豆精品国产91久久久久久| 成人性色生活片| 欧美亚洲日本国产| 欧美成人精品3d动漫h| 一区二区成人在线视频| 麻豆精品蜜桃视频网站| 懂色中文一区二区在线播放| 欧美午夜一区二区三区免费大片| 91精品久久久久久久91蜜桃| 中文字幕免费一区| 水野朝阳av一区二区三区| 国产很黄免费观看久久| 欧美日韩国产系列| 国产色产综合产在线视频| 亚洲自拍欧美精品| 国产精品99久久久久久似苏梦涵 | 欧美另类videos死尸| 久久久久久久久岛国免费| 亚洲综合色自拍一区| 久久 天天综合| 欧美色图第一页| 国产亚洲婷婷免费| 视频一区在线视频| 92精品国产成人观看免费| 日韩精品一区二| 一区二区三区蜜桃网| 国产成人综合视频| 欧美一区二区三区视频在线观看| 亚洲婷婷在线视频| 国产成人免费在线观看| 日韩午夜在线观看| 亚洲最大成人综合| 不卡的看片网站| 日韩精品一区二| 亚洲.国产.中文慕字在线| 久久九九全国免费| 免播放器亚洲一区| 精品视频在线看| 成人欧美一区二区三区在线播放| 韩国视频一区二区| 日韩午夜激情免费电影| 亚洲高清久久久| 一本久久a久久免费精品不卡| 日本一区二区三区在线不卡| 蓝色福利精品导航| 欧美日韩日日骚| 亚洲综合在线视频| 色呦呦网站一区| 亚洲情趣在线观看| 国产成人亚洲综合a∨婷婷| 精品久久五月天| 免费在线观看精品| 欧美一区二区三区白人| 亚洲成人免费视| 欧美色图在线观看| 亚洲一区在线观看免费| 99精品久久只有精品| 国产精品久久久久一区二区三区 | 一本一本大道香蕉久在线精品| 国产日韩在线不卡| 福利电影一区二区| 久久久久97国产精华液好用吗| 秋霞影院一区二区| 精品国产一区二区精华| 日本中文字幕一区二区视频 | 欧美三区在线观看| 日本中文字幕不卡| 91精品国产色综合久久 | 成人一区二区三区视频在线观看| 欧美精品一区二区蜜臀亚洲| 国产精品一卡二| 中文字幕不卡的av| 99久久国产综合精品女不卡| 国产精品妹子av| 一本久久精品一区二区| 一区二区三区波多野结衣在线观看 | 亚洲美女在线一区| 欧美午夜精品久久久久久超碰| 一区二区三区不卡视频在线观看| 欧美亚洲综合在线| 免费xxxx性欧美18vr| 久久婷婷国产综合国色天香 | 在线视频中文字幕一区二区| 亚洲高清不卡在线观看| 久久丝袜美腿综合| av电影一区二区| 偷拍与自拍一区| 欧美精品一区二区蜜臀亚洲| 一本一道波多野结衣一区二区| 亚洲午夜精品17c| www国产成人| av动漫一区二区| 美腿丝袜一区二区三区| 国产人成亚洲第一网站在线播放| 91一区二区在线观看| 五月婷婷另类国产| 国产亚洲婷婷免费| 欧美性猛交一区二区三区精品 | 99久久国产综合精品色伊| 亚洲一级不卡视频| 久久先锋影音av| 色先锋资源久久综合| 免费在线观看日韩欧美| 亚洲欧洲综合另类在线| 欧美日韩国产bt| 大尺度一区二区| 美女一区二区三区在线观看| 中文一区二区完整视频在线观看| 91精品在线观看入口| 波多野结衣91| 极品瑜伽女神91| 亚洲高清免费观看高清完整版在线观看| 久久综合成人精品亚洲另类欧美| 色88888久久久久久影院按摩| 久久97超碰色| 亚洲影院理伦片| 韩国欧美国产一区| 一区二区三区中文字幕| 国产亚洲精品免费| 911精品产国品一二三产区| 91亚洲精品久久久蜜桃网站| 激情久久五月天| 亚洲欧洲日韩女同| 久久老女人爱爱| 欧美日本韩国一区二区三区视频| 91色.com| 国产成人在线看| 国产成人夜色高潮福利影视| 日日夜夜精品视频免费| 亚洲一区二区免费视频| 国产精品网曝门| 国产欧美一区在线| 日韩色在线观看| 欧美理论片在线| 欧美午夜电影在线播放| 色综合久久天天| 91在线无精精品入口| 成人少妇影院yyyy|