applet2.java~7~

来自「在JAVA的APPLE中直方图的如何处理.」· JAVA~7~ 代码 · 共 67 行

JAVA~7~
67
字号
package zhifang;

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

public class Applet2
    extends JApplet {
  boolean isStandalone = false;
  JPanel jPanel1 = new JPanel();
  JSplitPane jSplitPane1 = new JSplitPane();
  JTree jTree1 = new JTree();
  //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();
    }
    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);
    this.getContentPane().add(jPanel1);
    jPanel1.add(jSplitPane1);
    jSplitPane1.add(jTree1, JSplitPane.BOTTOM);
    jSplitPane1.setBounds(new Rectangle( -2, 0, 384, 289));

  }

  //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 + =
减小字号Ctrl + -
显示快捷键?