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

📄 frame1.java

📁 我自己编写的科学计算器
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
    jLabel7.setFont(new java.awt.Font("Dialog", 0, 9));
    jLabel7.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel7.setText("  ");
    jLabel7.setForeground(this.getBackground());
    jLabel8.setFont(new java.awt.Font("Dialog", 0, 9));
    jLabel8.setForeground(this.getBackground());
    jPanel11.setLayout(borderLayout9);
    jLabel9.setFont(new java.awt.Font("华文仿宋", 1, 17));
    jLabel9.setForeground(SystemColor.activeCaption);
    jLabel9.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel9.setText("   科学计算功能   ");
    jPanel11.setBorder(BorderFactory.createEtchedBorder());
    jPanel12.setLayout(borderLayout10);
    jButton31.setForeground(Color.blue);
    jButton31.setText("x~y");
    jButton31.addActionListener(new Frame1_jButton31_actionAdapter(this));
    jButton30.setForeground(Color.magenta);
    jButton30.setText("n!");
    jButton30.addActionListener(new Frame1_jButton30_actionAdapter(this));
    gridLayout4.setRows(5);
    gridLayout4.setVgap(3);
    gridLayout4.setColumns(3);
    gridLayout4.setHgap(3);
    jButton28.setForeground(Color.blue);
    jButton28.setText("x^2");
    jButton28.addActionListener(new Frame1_jButton28_actionAdapter(this));
    jButton33.setForeground(Color.magenta);
    jButton33.setText("tan");
    jButton33.addActionListener(new Frame1_jButton33_actionAdapter(this));
    jButton27.setForeground(Color.magenta);
    jButton27.setText("cos");
    jButton27.addActionListener(new Frame1_jButton27_actionAdapter(this));
    jButton29.setForeground(Color.blue);
    jButton29.setText("x^y");
    jButton29.addActionListener(new Frame1_jButton29_actionAdapter(this));
    jButton36.setFont(new java.awt.Font("Dialog", 0, 11));
    jButton36.setForeground(Color.magenta);
    jButton36.setText("exp");
    jButton36.addActionListener(new Frame1_jButton36_actionAdapter(this));
    jButton26.setForeground(Color.magenta);
    jButton26.setText("1/x");
    jButton26.addActionListener(new Frame1_jButton26_actionAdapter(this));
    jButton35.setForeground(Color.blue);
    jButton35.setText("x~2");
    jButton35.addActionListener(new Frame1_jButton35_actionAdapter(this));
    jPanel13.setBorder(null);
    jPanel13.setLayout(gridLayout4);
    jButton25.setForeground(Color.magenta);
    jButton25.setText("sin");
    jButton25.addActionListener(new Frame1_jButton25_actionAdapter(this));
    jButton34.setForeground(Color.magenta);
    jButton34.setText("ctg");
    jButton34.addActionListener(new Frame1_jButton34_actionAdapter(this));
    jButton32.setForeground(Color.magenta);
    jButton32.setText("n+");
    jButton32.addActionListener(new Frame1_jButton32_actionAdapter(this));
    jButton37.setForeground(Color.magenta);
    jButton37.setText("ln");
    jButton37.addActionListener(new Frame1_jButton37_actionAdapter(this));
    jButton38.setForeground(Color.blue);
    jButton38.setText("log");
    jButton38.addActionListener(new Frame1_jButton38_actionAdapter(this));
    jButton39.setFont(new java.awt.Font("Dialog", 1, 11));
    jButton39.setToolTipText("键盘P");
    jButton39.setText("pi");
    jButton39.addActionListener(new Frame1_jButton39_actionAdapter(this));
    jLabel11.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel11.setText("  ");
    jLabel12.setText("  ");
    jLabel12.setForeground(this.getBackground());
    jLabel11.setForeground(this.getBackground());
    jLabel13.setFont(new java.awt.Font("Dialog", 1, 11));
    jLabel13.setForeground(SystemColor.desktop);
    jLabel13.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel13.setText("Neutron Studio 2006");
    jLabel14.setFont(new java.awt.Font("Dialog", 1, 11));
    jLabel14.setForeground(SystemColor.activeCaption);
    jLabel14.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel14.setText("Ology Calculate");
    jMenuItem9.setText("复制");
    jMenuItem122.setText("面板切换");
    jMenuItem122.addActionListener(new Frame1_jMenuItem122_actionAdapter(this));
    jMenuFile.add(jMenuItem122);
    jMenuFile.add(jMenuItem122);
    jMenuFile.addSeparator();
    jMenuFile.add(jMenuFileExit);
    jMenuBar1.add(jMenuFile);
    jMenuBar1.add(jMenu1);
    jMenuBar1.add(jMenuHelp);
    contentPane.add(jPanel1, BorderLayout.CENTER);
    jPanel1.add(jPanel8, BorderLayout.CENTER);
    jPanel8.add(jPanel7, BorderLayout.CENTER);
    jPanel2.add(jPanel3, BorderLayout.NORTH);
    jPanel3.add(jLabel1, null);
    jPanel2.add(jPanel4, BorderLayout.CENTER);
    jPanel6.add(jBa_Num7, null);
    jPanel6.add(jBa_Num8, null);
    jPanel6.add(jBa_Num9, null);
    jPanel6.add(jBa_Opadd, null);
    jPanel6.add(jBa_Num4, null);
    jPanel6.add(jBa_Num5, null);
    jPanel6.add(jBa_Num6, null);
    jPanel6.add(jBa_Opminus, null);
    jPanel6.add(jBa_Num1, null);
    jPanel6.add(jBa_Num2, null);
    jPanel6.add(jBa_Num3, null);
    jPanel6.add(jBa_Opmultiply, null);
    jPanel6.add(jBa_Opequal, null);
    jPanel6.add(jBa_Num0, null);
    jPanel6.add(jBa_Opdel, null);
    jPanel6.add(jBa_Opdivision, null);
    jPanel1.add(jLabel2, BorderLayout.SOUTH);
    jPanel1.add(jLabel3, BorderLayout.WEST);
    jPanel1.add(jLabel4, BorderLayout.EAST);
    jPanel1.add(jLabel5, BorderLayout.NORTH);
    contentPane.add(jPanel9,  BorderLayout.EAST);
    jPanel9.add(jPanel10,  BorderLayout.CENTER);
    jPanel10.add(jPanel11, BorderLayout.CENTER);
    jPanel11.add(jLabel9, BorderLayout.NORTH);
    jPanel11.add(jPanel12, BorderLayout.CENTER);
    jPanel12.add(jPanel13, BorderLayout.CENTER);
    jPanel13.add(jButton25, null);
    jPanel13.add(jButton29, null);
    jPanel13.add(jButton26, null);
    jPanel13.add(jButton27, null);
    jPanel13.add(jButton28, null);
    jPanel13.add(jButton30, null);
    jPanel13.add(jButton33, null);
    jPanel13.add(jButton31, null);
    jPanel13.add(jButton32, null);
    jPanel13.add(jButton34, null);
    jPanel13.add(jButton35, null);
    jPanel13.add(jButton36, null);
    jPanel13.add(jButton37, null);
    jPanel13.add(jButton38, null);
    jPanel13.add(jButton39, null);
    jPanel12.add(jLabel11, BorderLayout.EAST);
    jPanel12.add(jLabel12,  BorderLayout.WEST);
    jPanel12.add(jLabel13,  BorderLayout.SOUTH);
    jPanel12.add(jLabel14, BorderLayout.NORTH);
    jPanel9.add(jLabel6, BorderLayout.NORTH);
    jPanel9.add(jLabel7,  BorderLayout.SOUTH);
    jPanel9.add(jLabel8,  BorderLayout.WEST);
    jPanel4.add(jPanel5, BorderLayout.NORTH);
    jPanel4.add(jPanel6, BorderLayout.CENTER);
    jPanel5.add(jBb_CE, null);
    jPanel5.add(jButton2, null);
    jPanel5.add(jButton3, null);
    jPanel5.add(jButton7, null);
    jPanel5.add(jBb_VE, null);
    jPanel5.add(jButton6, null);
    jPanel5.add(jButton4, null);
    jPanel5.add(jButton8, null);
    jPanel7.add(jTshow, BorderLayout.NORTH);
    jPanel7.add(jPanel2, BorderLayout.CENTER);
    jMenu1.add(jMenu3);
    jMenu3.add(jMenuItem3);
    jMenu3.add(jMenuItem4);
    jMenu3.add(jMenuItem5);
    this.setJMenuBar(jMenuBar1);
    jMenuHelp.add(jMenuHelpAbout);
    jMenuHelp.add(jMenuItem6);
    jPopupMenu1.addSeparator();
    jPopupMenu1.add(jMenuItem9);
    //读取配置设置的信息
 try {
 File fileRead=new File("计算器配置设置.ini");
 BufferedReader in = new BufferedReader( new FileReader(fileRead));
 String sss=in.readLine();
d2=Integer.valueOf(sss).intValue();
if(d2==1){
   jButton7.setText(">");
 jButton7.setForeground(Color.green);
  jPanel9.setVisible(false);
}
 else{
   jButton7.setText("<");
   jButton7.setForeground(Color.red);
  jPanel9.setVisible(true);
 }
 in.close();
}
 catch (Exception r) {
}



    //读取配置设置的信息
    this.pack();
 /////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////
 //-------------------------------------------------0
    ActionListener a01=new ActionListener(){
public void actionPerformed(ActionEvent ae){
    jBa_Num0.doClick();
}
};
getRootPane().registerKeyboardAction(
a01,KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD0,0,false),
JComponent.WHEN_IN_FOCUSED_WINDOW);
//------------------------------------------------------0
//------------------------------------------------------1
    ActionListener a02=new ActionListener(){
 public void actionPerformed(ActionEvent ae){
   jBa_Num1.doClick();
 }
 };
 getRootPane().registerKeyboardAction(
 a02,KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD1,0,false),
 JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------1
    //------------------------------------------------------2
       ActionListener a03=new ActionListener(){
    public void actionPerformed(ActionEvent ae){
      jBa_Num2.doClick();
    }
    };
    getRootPane().registerKeyboardAction(
    a03,KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD2,0,false),
    JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------2
//------------------------------------------------------3
   ActionListener a04=new ActionListener(){
public void actionPerformed(ActionEvent ae){
  jBa_Num3.doClick();
}
};
getRootPane().registerKeyboardAction(
a04,KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD3,0,false),
JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------3
    //------------------------------------------------------4
      ActionListener a05=new ActionListener(){
   public void actionPerformed(ActionEvent ae){
     jBa_Num4.doClick();
   }
   };
   getRootPane().registerKeyboardAction(
   a05,KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD4,0,false),
   JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------4
//------------------------------------------------------5
    ActionListener a06=new ActionListener(){
 public void actionPerformed(ActionEvent ae){
  jBa_Num5.doClick();
}
 };
 getRootPane().registerKeyboardAction(
 a06,KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD5,0,false),
 JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------5
    //------------------------------------------------------6
      ActionListener a07=new ActionListener(){
   public void actionPerformed(ActionEvent ae){
    jBa_Num6.doClick();
   }
   };
   getRootPane().registerKeyboardAction(
   a07,KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD6,0,false),
   JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------6
//------------------------------------------------------7
    ActionListener a7=new ActionListener(){
 public void actionPerformed(ActionEvent ae){
  jBa_Num7.doClick();
 }
 };
 getRootPane().registerKeyboardAction(
 a7,KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD7,0,false),
 JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------7
    //------------------------------------------------------8
      ActionListener a8=new ActionListener(){
   public void actionPerformed(ActionEvent ae){
    jBa_Num8.doClick();

   }
   };
   getRootPane().registerKeyboardAction(
   a8,KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD8,0,false),
   JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------8
//------------------------------------------------------9
    ActionListener a9=new ActionListener(){
 public void actionPerformed(ActionEvent ae){
   jBa_Num9.doClick();

 }
 };
 getRootPane().registerKeyboardAction(
 a9,KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD9,0,false),
 JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------9
//------------------------------------------------------+
    ActionListener a10=new ActionListener(){
 public void actionPerformed(ActionEvent ae){
   jBa_Opadd.doClick();

 }
 };
 getRootPane().registerKeyboardAction(
 a10,KeyStroke.getKeyStroke(KeyEvent.VK_ADD,0,false),
 JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------+
    //------------------------------------------------------ -
      ActionListener a11=new ActionListener(){
   public void actionPerformed(ActionEvent ae){
   jBa_Opminus.doClick();
 }
   };
   getRootPane().registerKeyboardAction(
   a11,KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT,0,false),
   JComponent.WHEN_IN_FOCUSED_WINDOW);

//------------------------------------------------------- -
    //------------------------------------------------------*
      ActionListener a12=new ActionListener(){
   public void actionPerformed(ActionEvent ae){
    jBa_Opmultiply.doClick();

 }
   };
   getRootPane().registerKeyboardAction(
   a12,KeyStroke.getKeyStroke(KeyEvent.VK_MULTIPLY,0,false),
   JComponent.WHEN_IN_FOCUSED_WINDOW);

//-------------------------------------------------------*
    //------------------------------------------------------/
        ActionListener a13=new ActionListener(){
     public void actionPerformed(ActionEvent ae){
      jBa_Opdivision.doClick();


   }
     };
     getRootPane().registerKeyboardAction(
     a13,KeyStroke.getKeyStroke(KeyEvent.VK_DIVIDE,0,false),
     JComponent.WHEN_IN_FOCUSED_WINDOW);

//-------------------------------------------------------/
  //------------------------------------------------------=

⌨️ 快捷键说明

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