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

📄 applet2.java~11~

📁 在JAVA的APPLE中直方图的如何处理.
💻 JAVA~11~
字号:
package zhifang;

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;


public class Applet2
    extends JApplet {
  boolean isStandalone = false;
  JPanel jPanel1 = new JPanel();
  JSplitPane jSplitPane1 = new JSplitPane();
  JTree jTree1 = new JTree();
  DefaultMutableTreeNode root;
  DefaultMutableTreeNode temNode;
  //Get a parameter value
  public String getParameter(String key, String def) {
    return isStandalone ? System.getProperty(key, def) :
        (getParameter(key) != null ? getParameter(key) : def);
  }

  //Construct the applet
  public Applet2() {
  }

  //Initialize the applet
  public void init() {
    try {
      jbInit();
      root = new DefaultMutableTreeNode("wangjydfkljfdljkdfjldfkldfjkljkldfjkldfjkl");
      temNode=new DefaultMutableTreeNode("wangjydfkljfdljkdfjldfkldfjkljkldfjkldfjkl is son");
      root.add(temNode);
      DefaultMutableTreeNode tem=new DefaultMutableTreeNode("sonson");
      for(int i=0;i<5;i++){
        temNode.add(tem);
      }
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  }

  //Component initialization
  private void jbInit() throws Exception {
    this.setSize(new Dimension(400, 300));
    this.getContentPane().setLayout(null);
    jPanel1.setBounds(new Rectangle(4, 0, 393, 297));
    jPanel1.setLayout(null);
    jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);//垂直切份
    this.getContentPane().add(jPanel1);
    jPanel1.add(jSplitPane1);
    jSplitPane1.add(jTree1, JSplitPane.BOTTOM);
    jSplitPane1.setBounds(new Rectangle(21, 0, 384, 289));
    jSplitPane1.setDividerLocation(100);
    jTree1.setEnabled(true);
        jTree1.setAutoscrolls(true);
        jTree1.setBorder(BorderFactory.createLineBorder(Color.black));
        jTree1.setRequestFocusEnabled(true);
        jTree1.setCellEditor(null);
        jTree1.setEditable(false);
        jTree1.setExpandsSelectedPaths(true);
        jTree1.setRootVisible(true);
  }

  //Get Applet information
  public String getAppletInfo() {
    return "Applet Information";
  }

  //Get parameter info
  public String[][] getParameterInfo() {
    return null;
  }

  //static initializer for setting look & feel
  static {
    try {
      //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    }
    catch (Exception e) {
    }
  }
}

⌨️ 快捷键说明

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