src/MyComputer.java

(开头部分) 13KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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

public class MyComputer extends JFrame implements ActionListener
    {  
       JTextArea memoryArea=new JTextArea(" ",1,3);
       JTextArea process=new JTextArea(" ",1,20);
       JTextArea dispresult=new JTextArea("0.   ",1,20);
       Font font1=new Font("Vani",Font.BOLD,18 );
       Font font2=new Font("Arial Rounded MT  Bold",Font.PLAIN,10 );
       Font font3=new Font("Arial Rounded MT  Bold",Font.PLAIN,30 );
       Font font4=new Font("Vani",Font.PLAIN,15);

       JButton[]jbuttons=new JButton[32];
       
       double result=0,first=0,second=0;
       double memery=0;
       char firstsymbol='\0',secondsymbol='\0';
       boolean prev=true,repeat=true,dot=true;
     MyComputer()
    {
	       super("Calculator");
	       this.setTitle("计算器");
	       try
	       {  
	    	   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
	       } catch(Exception e)
	       {
	           System.out.println(e);
	       }
	       JPanel resultField=new JPanel();
	       resultField.setLayout(new GridLayout(3,1));
	       
	       JPanel buttonField=new JPanel();
	       Container all=getContentPane();
	
	       GridLayout grid1;
	       grid1=new GridLayout(8,4,0,0);
	
	       memoryArea.setFont(font3);
	       dispresult.setFont(font3);
	       process.setFont(font4);
	       memoryArea.setEditable(false);
	       process.setEditable(false);
	       dispresult.setEditable(false);
	      
	
	       resultField.add(memoryArea);
	       resultField.add(process);
	       resultField.add(dispresult);
	       
	       all.add(resultField,"North");
	       
	       String[]buttonname={"MS","MC","MR","M+","1/x","x2","√","㏒","%","sin","cos","tan","CE","C","back","÷","7","8","9","×","4","5","6","-","1","2","3","+","±","0",".","="};
	
	       buttonField.setLayout(grid1);
	       //buttonField.setBackground(Color.LIGHT_GRAY);
	       for(int i=0;i<4;i++)
		   {
后面还有 534 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。