⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 btnpan.java

📁 JTREE的例子
💻 JAVA
字号:
package util3;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.io.*;import util4.*;public class BtnPan extends JPanel {  private BorderLayout borderLayout1 = new BorderLayout();  EditorResListener erlistener=null;  String name=null;  Tree myTree=null;  private JSplitPane splitPan = new JSplitPane();  private JPanel upPan = new JPanel();  private JPanel downPan = new JPanel();  private BorderLayout borderLayout2 = new BorderLayout();  private BorderLayout borderLayout3 = new BorderLayout();  private JScrollPane scrollPan = new JScrollPane();  private JPanel treePan = new JPanel();  private BorderLayout borderLayout4 = new BorderLayout();  private JLabel jLabel1 = new JLabel();  private JScrollPane jScrollPane1 = new JScrollPane();  private JTextArea attArea = new JTextArea();  public BtnPan(Frame f,String name) {    this.erlistener=(EditorResListener)f;    this.name=name;    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  private void jbInit() throws Exception {    this.setLayout(borderLayout1);    Tree tree=new Tree(this);    myTree=tree;    splitPan.setOrientation(JSplitPane.VERTICAL_SPLIT);    splitPan.setDividerLocation(230);    splitPan.setOneTouchExpandable(true);    upPan.setLayout(borderLayout2);    downPan.setLayout(borderLayout3);    upPan.setBackground(Color.white);    downPan.setBackground(Color.white);    scrollPan.getViewport().setBackground(Color.white);    scrollPan.setBorder(null);    treePan.setLayout(borderLayout4);    treePan.setBackground(Color.white);    jLabel1.setFont(new java.awt.Font("Dialog", 0, 55));    jLabel1.setText(" ");    attArea.setForeground(Color.blue);    attArea.setBorder(null);    attArea.setEditable(false);    attArea.setLineWrap(true);    jScrollPane1.setBorder(null);    this.add(splitPan, BorderLayout.CENTER);    splitPan.add(upPan, JSplitPane.TOP);    upPan.add(scrollPan,  BorderLayout.CENTER);    scrollPan.getViewport().add(treePan, null);    splitPan.add(downPan, JSplitPane.BOTTOM);    downPan.add(jScrollPane1, BorderLayout.CENTER);    jScrollPane1.getViewport().add(attArea, null);    treePan.add(jLabel1, BorderLayout.SOUTH);    treePan.add(tree,BorderLayout.CENTER);  }//initial and constructor finished.  public void showAtt(String str){    this.attArea.setText(str);  }  public void displayPopMenu(JPopupMenu menu, Tree t, MouseEvent e){  }  public void importFile(File file) throws Exception{    myTree.importXML(file);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -