checkpanel.java

来自「java的继承机制的演示」· Java 代码 · 共 44 行

JAVA
44
字号
package modelcheck;
import javax.swing.*;
import java.awt.*;
public class CheckPanel extends JPanel{
  JTextPane jTextPane1 = new JTextPane();
  JCheckBox jCheckBoxWarn = new JCheckBox();
  JCheckBox jCheckBoxError = new JCheckBox();
  JLabel jLabel1 = new JLabel();
  CheckItem checkItem =new CheckItem();
  int phrase=0,model=0,warn=0,error=0;
  public CheckPanel(int phrase,int model,int  warn,int error)   {
    try {//传过来的值是阶段,模型,警告信息数组,错误信息数组 下标
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
  private void jbInit() throws Exception {
    this.phrase=phrase;
    this.warn=warn;
    this.error=error;
    this.model=model;
    jTextPane1.setEnabled(false);
    jTextPane1.setEditable(false);
    jTextPane1.setText("");
    jTextPane1.setBounds(new Rectangle(0, 37, 398, 263));
    this.setEnabled(false);
    this.setDebugGraphicsOptions(0);
    this.setDoubleBuffered(true);
    this.setLayout(null);
    jCheckBoxWarn.setText("警告");
    jCheckBoxWarn.setBounds(new Rectangle(204, 4, 104, 25));
    jCheckBoxError.setText("错误");
    jCheckBoxError.setBounds(new Rectangle(312, 3, 110, 26));
    jLabel1.setText("请选择"+checkItem.modelName[phrase][model]+"模型检测类型:");
    jLabel1.setBounds(new Rectangle(9, 5, 186, 28));
    this.add(jTextPane1, null);
    this.add(jLabel1, null);
    this.add(jCheckBoxWarn, null);
    this.add(jCheckBoxError, null);
  }
}

⌨️ 快捷键说明

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