科学计算器dy570(卡西欧计算器怎么关机)

2025-05-03 09:33:06 0

科学计算器dy570(卡西欧计算器怎么关机)

各位老铁们,大家好,今天由我来为大家分享科学计算器dy570,以及卡西欧计算器怎么关机的相关问题知识,希望对大家有所帮助。如果可以帮助到大家,还望关注收藏下本站,您的支持是我们最大的动力,谢谢大家了哈,下面我们开始吧!

本文目录

卡西欧计算器怎么关机

卡西欧计算器关机方法如下:

工具:卡西欧计算器fx-991cnx。

1、先按下计算器上的shift按键。

2、再按下开机键(英文版是off)即可关机。

产品迭代

1、1957年推出全自动小型计算器Casio 14-A。

2、1972年推出个人计算器Casio Mini。

3、1983年推出SL-800厚度仅为0.8mm信用卡尺寸的超薄计算器。

4、1985年推出可根据图形直观把握数学公式的函数计算器fx-7000G。

5、2003年推出函数计算器fx-82MS。

6、2010年推出首款中文彩图图形计算器fx-CG20。

7、2014年推出中文显示函数计算器fx-991CN X,中国限定版真人发音语音机DY-120。

8、2017年fx-CG50图形计算器上市。

9、2018年JW-200SC雅智系列办公机上市。

10、2019年DY-120语音机中国限定新色上市。

11、2019年fx-991CN X函数机新色上市。

VB求一个科学计算器源代码,谢谢啦

由于本人级别不够,不能上传照片图片在你的QQ邮箱里运行界面,编程界面我发到你的邮箱里Option ExplicitDim s_id As IntegerDim s As StringDim s1 As DoubleFunction p(x As Double) As Boolean If InStr(x, ".") = 0 Then p = False Else p = True End IfEnd FunctionPrivate Sub C_Click(Index As Integer)Select Case s_id Case 0, 2 Text1.Text = Text1.Text & Index Case 1 Text1.Text = Index s_id = 2 Case 3 Text1.Text = Index s_id = 0 End SelectEnd SubPrivate Sub CmdAdd_Click()Select Case s_id Case 0 s = "+" s1 = Text1.Text s_id = 1 Case 2 CmdDY_Click s = "+" s1 = Text1.Text s_id = 1End SelectEnd SubPrivate Sub CmdBK_Click()If Len(Text1.Text) 》 0 Then Text1.Text = Mid(Text1.Text, 1, Len(Text1.Text) - 1)End IfEnd SubPrivate Sub CmdC_Click()s_id = 0Text1.Text = ""End SubPrivate Sub CmdCF_Click()s_id = 1s = "*"s1 = Text1.TextEnd SubPrivate Sub CmdDY_Click()If s_id = 2 Then Select Case s Case "+" Text1.Text = s1 + Val(Text1.Text) s_id = 3 Case "-" Text1.Text = s1 - Val(Text1.Text) s_id = 3 Case "*" Text1.Text = s1 * Val(Text1.Text) s_id = 3 Case "/" Text1.Text = s1 / Val(Text1.Text) s_id = 3 End SelectEnd IfEnd SubPrivate Sub CmdJF_Click()Select Case s_id Case 0 s = "-" s1 = Text1.Text s_id = 1 Case 2 CmdDY_Click s = "-" s1 = Text1.Text s_id = 1End SelectEnd SubPrivate Sub CmdP_Click()If Not p(Text1.Text) Then Text1.Text = Text1.Text & "."End IfEnd SubPrivate Sub Cmd**RT_Click()Text1.Text = Sqr(Val(Text1.Text))End SubPrivate Sub CmdX1_Click()Text1.Text = 1 / Val(Text1.Text)End SubPrivate Sub CmdZF_Click()Text1.Text = -Val(Text1.Text)End SubPrivate Sub Command20_Click()s_id = 1s = "/"s1 = Text1.TextEnd SubPrivate Sub Form_Load()Dim i As IntegerFor i = 0 To 9 C(i).Caption = iNext is_id = 0End Sub

java编一个计算器的代码

界面漂亮堪比系统自带计算器,功能完美加减乘除开平方等等全部具备,还有清零按钮,小数点的使用,连加连乘功能完全参考系统官方计算器经过长期调试改进而成,马上拷贝代码拿去试试看吧,绝不后悔! 代码如下: import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; public class Counter { public static void main(String args) { CounterFrame frame = new CounterFrame(); frame.show(); } } class CounterFrame extends JFrame { public CounterFrame() { JMenuBar menuBar = new JMenuBar(); JMenu menuFile = new JMenu(); JMenu menuFile1 = new JMenu(); JMenu menuFile2 = new JMenu(); JMenu menuFile3 = new JMenu(); JMenuItem menuFileExit = new JMenuItem(); menuFile.setText("文件"); menuFile1.setText(""); menuFile2.setText("查看"); menuFile3.setText("帮助"); menuFileExit.setText("退出"); menuFileExit.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { CounterFrame.this.windowClosed(); } } ); menuFile.add(menuFileExit); menuBar.add(menuFile); menuBar.add(menuFile1); menuBar.add(menuFile2); menuBar.add(menuFile3); setTitle("计算器"); setJMenuBar(menuBar); setSize(new Dimension(400, 280)); this.getContentPane().add(new Allpanel()); this.addWindowListener ( new WindowAdapter() { public void windowClosing(WindowEvent e) { CounterFrame.this.windowClosed(); } } ); } protected void windowClosed() { System.exit(0); } } class Tool { public static Tool instance; private JTextField field; private Tool() { this.field=new JTextField(30); this.field.setHorizontalAlignment(JTextField.RIGHT); } public static Tool getinstance() { if(instance==null) { instance=new Tool(); } return instance; } public JTextField getfield() { return (this.field); } } class Allpanel extends JPanel { public Allpanel() { this.setLayout(new BorderLayout(0,7)); Northpanel np=new Northpanel(); Centerpanel cp=new Centerpanel(); this.add(np,BorderLayout.NORTH); this.add(cp,BorderLayout.CENTER); } } class Centercenter extends JPanel { static Vector Vec=new Vector(); static Vector vc=new Vector(); static Vector vc1=new Vector(); static Vector vc2=new Vector(); static Vector vc3=new Vector(); static String begin="yes"; static double add; static double jq; static double cs; static double cq; static double dy; static String jg; static String what; static double tool=0; static String to="yes"; /** * Method Centercenter * * */ public Centercenter() { // TODO: Add your code here final JTextField text=Tool.getinstance().getfield(); this.setLayout(new GridLayout(4,5,3,3)); String arg ={"7","8","9","/","sqrt","4","5","6","*","%","1","2","3","-","1/x","0","+/-",".","+","="}; for(int i=0;i《20;i++) { final JButton b=new JButton(arg); //this.add(new JButton(arg)); this.add(b); if(i==0||i==1||i==2||i==5||i==6||i==7||i==10||i==11||i==12||i==15) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String mark=b.getText(); String ma=text.getText(); if(vc3.contains("v3")) { text.setText("0."+mark); vc3.clear(); } else if(vc.contains("a")) { if(vc2.contains("v2")) { text.setText("0."+mark); vc.clear(); vc2.clear(); } else { text.setText(mark); vc.clear(); Vec.clear(); Vec.add(mark); } } else { text.setText(ma.trim()+mark); Vec.add(mark); } begin="no"; to="yes"; } }); } if(i==17) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String mar=b.getText(); String m=text.getText(); if("yes".equals(begin)) { vc3.add("v3"); } if(vc1.contains("v1")) { vc2.add("v2"); vc1.clear(); } if(!Vec.contains(".")&&!vc.contains("a")) { text.setText(m.trim()+mar); Vec.add("."); } } }); } if(i==18) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); add=Double.parseDouble(ma); if(what==null) { tool=add; what="add"; } else { tool=tool+add; text.setText(String.valueOf((tool))); } vc.add("a"); vc1.add("v1"); to="+"; } }); } if(i==13) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); jq=Double.parseDouble(ma); if(what==null) { tool=jq; what="jq"; } else { tool=tool-jq; text.setText(String.valueOf((tool))); } vc.add("a"); vc1.add("v1"); to="-"; } }); } if(i==3) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); cq=Double.parseDouble(ma); if(what==null) { tool=cq; what="cq"; } else { tool=tool/cq; text.setText(String.valueOf((tool))); } vc.add("a"); vc1.add("v1"); to="/"; } }); } if(i==4) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); cq=Double.parseDouble(ma); text.setText(String.valueOf(Math.sqrt(cq))); } }); } if(i==8) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); cs=Double.parseDouble(ma); if(what==null) { tool=cs; what="cs"; } else { tool=tool*cs; text.setText(String.valueOf((tool))); } vc.add("a"); vc1.add("v1"); to="*"; } }); } if(i==19) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); dy=Double.parseDouble(ma); if(what=="add") { jg=String.valueOf((tool+dy)); } if(what=="jq") { jg=String.valueOf((tool-dy)); } if(what=="cs") { jg=String.valueOf((tool*dy)); } if(what=="cq") { jg=String.valueOf((tool/dy)); } if(what==null) { if(to=="+") { tool=add; jg=String.valueOf(tool+dy); } else if(to=="-") { tool=jq; jg=String.valueOf(dy-tool); } else if(to=="*") { tool=cs; jg=String.valueOf(dy*tool); } else if(to=="/") { tool=cq; jg=String.valueOf(dy/tool); } else { jg=String.valueOf(dy); } } text.setText(jg); Vec.clear(); Vec.add("."); vc.add("a"); vc1.add("v1"); what=null; tool=0; } }); } } } } class Centernorth extends JPanel { public Centernorth() { final JTextField text=Tool.getinstance().getfield(); JButton jb1=new JButton("Backspace"); JButton jb2=new JButton(" CE "); JButton jb3=new JButton(" C "); this.add(jb1); this.add(jb2); this.add(jb3); jb1.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { String back=Tool.getinstance().getfield().getText(); text.setText(backmethod(back)); Centercenter.Vec.remove(Centercenter.Vec.size()-1); } }); jb3.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { text.setText("0."); Centercenter.Vec.clear(); Centercenter.Vec.add("."); Centercenter.vc.add("a"); Centercenter.begin="yes"; Centercenter.vc1.clear(); Centercenter.what=null; Centercenter.tool=0; } }); } public String backmethod(String str) { return str.substring(0,str.length()-1); } } class Centerpanel extends JPanel { public Centerpanel() { this.setLayout(new BorderLayout(8,7)); Centernorth cn=new Centernorth(); Centercenter cc=new Centercenter(); Centerwest cw=new Centerwest(); this.add(cn,BorderLayout.NORTH); this.add(cc,BorderLayout.CENTER); this.add(cw,BorderLayout.WEST); } } class Centerwest extends JPanel { public Centerwest() { this.setLayout(new GridLayout(4,1,3,3)); this.add(new JButton("MC")); this.add(new JButton("MR")); this.add(new JButton("MS")); this.add(new JButton("M+")); } } class Northpanel extends JPanel { private JTextField tf; public Northpanel() { tf=Tool.getinstance().getfield(); this.add(tf); } } ---------------------------------------------------------------------------=============《按你要求特意后改过的最简单功能的代码如下》========================import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.util.*;public class Counter2 { public static void main(String args) { CounterFrame frame = new CounterFrame(); frame.show(); }}class CounterFrame extends JFrame { public CounterFrame() { setTitle("计算器"); setSize(new Dimension(400, 280)); this.getContentPane().add(new Allpanel()); this.addWindowListener ( new WindowAdapter() { public void windowClosing(WindowEvent e) { CounterFrame.this.windowClosed(); } } ); } protected void windowClosed() { System.exit(0); }}class Tool {public static Tool instance; private JTextField field; private Tool() { this.field=new JTextField(30); this.field.setHorizontalAlignment(JTextField.RIGHT); }public static Tool getinstance() { if(instance==null) { instance=new Tool(); } return instance; } public JTextField getfield() { return (this.field); } }class Allpanel extends JPanel { public Allpanel() { this.setLayout(new BorderLayout(0,7)); Northpanel np=new Northpanel(); Centerpanel cp=new Centerpanel(); this.add(np,BorderLayout.NORTH); this.add(cp,BorderLayout.CENTER); } }class Centercenter extends JPanel {static Vector Vec=new Vector(); static Vector vc=new Vector(); static Vector vc1=new Vector(); static Vector vc2=new Vector(); static Vector vc3=new Vector(); static String begin="yes"; static double add; static double jq; static double cs; static double cq; static double dy; static String jg; static String what; static double tool=0; static String to="yes"; /** * Method Centercenter * * */ public Centercenter() { // TODO: Add your code here final JTextField text=Tool.getinstance().getfield(); this.setLayout(new GridLayout(4,5,3,3)); String arg ={"7","8","9","/","4","5","6","*","1","2","3","-","0","=",".","+"}; for(int i=0;i《16;i++) { final JButton b=new JButton(arg); //this.add(new JButton(arg)); this.add(b); if(i==0||i==1||i==2||i==4||i==5||i==6||i==8||i==9||i==10||i==12) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String mark=b.getText(); String ma=text.getText(); if(vc3.contains("v3")) { text.setText("0."+mark); vc3.clear(); }else if(vc.contains("a")) { if(vc2.contains("v2")) { text.setText("0."+mark); vc.clear(); vc2.clear();} else { text.setText(mark); vc.clear(); Vec.clear(); Vec.add(mark); }} else { text.setText(ma.trim()+mark); Vec.add(mark); } begin="no"; to="yes";} }); }if(i==14) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String mar=b.getText(); String m=text.getText(); if("yes".equals(begin)) { vc3.add("v3"); } if(vc1.contains("v1")) { vc2.add("v2"); vc1.clear(); } if(!Vec.contains(".")&&!vc.contains("a")) { text.setText(m.trim()+mar); Vec.add("."); } } }); } if(i==15) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); add=Double.parseDouble(ma); if(what==null) { tool=add; what="add"; } else { tool=tool+add; text.setText(String.valueOf((tool))); } vc.add("a"); vc1.add("v1"); to="+"; } }); } if(i==11) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); jq=Double.parseDouble(ma); if(what==null) { tool=jq; what="jq"; } else { tool=tool-jq; text.setText(String.valueOf((tool))); } vc.add("a"); vc1.add("v1"); to="-"; } }); } if(i==3) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); cq=Double.parseDouble(ma); if(what==null) { tool=cq; what="cq"; } else { tool=tool/cq; text.setText(String.valueOf((tool))); } vc.add("a"); vc1.add("v1"); to="/"; } }); }if(i==7) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); cs=Double.parseDouble(ma); if(what==null) { tool=cs; what="cs"; } else { tool=tool*cs; text.setText(String.valueOf((tool))); } vc.add("a"); vc1.add("v1"); to="*"; } }); } if(i==13) { b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String ma=text.getText(); dy=Double.parseDouble(ma); if(what=="add") { jg=String.valueOf((tool+dy)); } if(what=="jq") { jg=String.valueOf((tool-dy)); } if(what=="cs") { jg=String.valueOf((tool*dy)); } if(what=="cq") { jg=String.valueOf((tool/dy)); } if(what==null) { if(to=="+") { tool=add; jg=String.valueOf(tool+dy); } else if(to=="-") { tool=jq; jg=String.valueOf(dy-tool); } else if(to=="*") { tool=cs; jg=String.valueOf(dy*tool); } else if(to=="/") { tool=cq; jg=String.valueOf(dy/tool); } else { jg=String.valueOf(dy); } } text.setText(jg); Vec.clear(); Vec.add("."); vc.add("a"); vc1.add("v1"); what=null; tool=0; } }); } }} }class Centernorth extends JPanel { public Centernorth() { final JTextField text=Tool.getinstance().getfield(); } }class Centerpanel extends JPanel { public Centerpanel() { this.setLayout(new BorderLayout(8,7)); Centernorth cn=new Centernorth(); Centercenter cc=new Centercenter(); Centerwest cw=new Centerwest(); this.add(cn,BorderLayout.NORTH); this.add(cc,BorderLayout.CENTER); this.add(cw,BorderLayout.WEST); } }class Centerwest extends JPanel { public Centerwest() { } }class Northpanel extends JPanel { private JTextField tf; public Northpanel() { tf=Tool.getinstance().getfield(); this.add(tf); } }------------------------------------------------------------才子_辉祝您愉快!

dy的笔记本是什么牌子

dy的笔记本是惠普牌子。

1939年1月1日,比尔和戴夫决定成立由他们两人组成的公司,并且用他们自己的名字休利特Hewlett和帕卡德Packard作为公司的名称。那么谁的名字放在公司名称的前面呢?他们决定用掷硬币的方法来决定。比尔·休利特赢了。于是,休利特-帕卡德电子仪器公司(HP)诞生了。

比尔.休利特(BillHewlett)和戴维.帕尔德(DavePackard),取中间的第一个度字母,到中国后根据中国人的文化取名为惠普。也可以理解为“因为实惠,所以普及”。

扩展资料:

家用产品线的中高端型号是HP Pavilion(畅游人)系列,中低端则是HP Compaq Presario(自由人)系列。值得一提的是,原本属于Pavilion系列中的HDX被独立出来,成为家用产品线的第三大系列,定位高端市场。

惠普(HP)提供的产品涵盖了IT基础设施,个人计算及接入设备,全球服务,面向个人消费者、大中小型企业的打印和成像等领域。主要专注于生产打印机、数码影像、软件、计算机与资讯服务等业务。

发展历程:

1934年,戴维·帕卡德(Dave Packard)和比尔·休利特(Bill Hewlett)二人决定开办公司并自己经营。1938年,比尔和戴维用538美元流动资金,研制成功了惠普第一台产品:阻容式声频振荡器(HP200A)。1939年1月1日,成立合伙公司。

1940年,公司迁址一座租赁大楼内。1942年,建造惠普第一座办公大楼 。1943年,惠普进入微波技术领域。1947年8月18日,惠普注册为股份制公司。

参考资料来源:百度百科_惠普

dy是什么牌子的电脑

dy是由于把商标看反了,如本文的图示,应该是hp(中文名:惠普)的电脑品牌。惠普成立于1939年,总部位于美国加利福尼亚州帕洛阿尔托市。惠普下设三大业务集团:信息产品集团、打印机成像系统集团和企业计算机专业服务集团。

中国惠普有限公司成立于1985年,是中国第一家中美合资的高科技企业。在二十年的发展历程中,中国惠普始终保持业务的高速增长,是HP全球业务增长最为迅速的子公司之一。

中国惠普公司总部位于北京,在国内设立了九大区域总部、37个支持服务中心、超过200个金牌服务网点、惠普商学院、惠普IT管理学院和惠普软件工程学院,现有员工3000多人。中国惠普有限公司致力于以具有竞争力的价格,为中国用户提供科技领先的产品与服务,培养一流人才、提供最佳客户体验,并最终与中国共同成长。

中国惠普业务范围涵盖IT基础设施、全球服务、商用和家用计算以及打印和成像等领域,客户遍及电信、金融、政府、交通、运输、能源、航天、电子、制造和教育等各个行业。

扩展资料:

1939年,在美国加州帕洛阿尔托市(Palo Alto)爱迪生大街367号的一间狭窄**里两位年轻的发明家比尔.休利特(Bill Hewlett)和戴维.帕卡德(David Packard),以手边仅有的538美元,怀着对未来技术发展的美好憧憬和发明创造的激情创建了HP公司,开始了硅谷的创新之路。

自1966年成立以来,惠普实验室一直以打印、计算和通信等领域的技术发明与创新推动惠普(HP)的成长。早期的研究成果包括便携式科学计算器、发光二极管、热喷墨打印、精简指令架构技术(RISC)以及第一台具有台式机性能的便携电脑等。

求一份J**A计算器源代码,要有()+-*/和清除键及小数点的,不用科学计算器

import java.awt.BorderLayout;import java.awt.Dimension;import java.awt.GridLayout;import java.awt.Toolkit;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JPanel;import javax.swing.SwingUtilities;import javax.swing.UIManager;class CalculatorPanel extends JPanel {private JPanel jp; // 中间的面板private double result; // 计算结果private boolean start; // 用于判断是否是首次输入,true首次,false不是首次private boolean flag; // 用于判断是否清空显示区域的值,true需要,false不需要private String lastCommand; // 用于保存运算符JButton display; // 显示区域public CalculatorPanel() {// 初始化各项值result = 0;start = true;flag = false;lastCommand = "=";// 设置CalculatorPanel这个面板的布局为框架布局setLayout(new BorderLayout());// 这个按钮用来显示值的区域display = new JButton("0.0");display.setEnabled(false);// 按钮样式设置为禁用样式// 用来初始化,清除用的JButton clear = new JButton("clear");clear.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {// 作初始化的操作result = 0;start = true;flag = false;lastCommand = "=";display.setText("0.0");}});jp = new JPanel();// 将此面板布局设置为网格布局,4行4列jp.setLayout(new GridLayout(4, 4));// 实例化**器对象NumberAction na = new NumberAction();CommandAction ca = new CommandAction();makeButton("7", na);makeButton("8", na);makeButton("9", na);makeButton("/", ca);makeButton("4", na);makeButton("5", na);makeButton("6", na);makeButton("*", ca);makeButton("1", na);makeButton("2", na);makeButton("3", na);makeButton("-", ca);makeButton("0", na);makeButton(".", na);makeButton("+", ca);makeButton("=", ca);// 将面板,两个按键加入到我的面板,实现计算器的界面add(display, BorderLayout.NORTH);add(jp, BorderLayout.CENTER);add(clear, BorderLayout.SOUTH);}private void makeButton(String buttonName, ActionListener al) {JButton jb = new JButton(buttonName);jp.add(jb);jb.addActionListener(al);}// 数字**器private class NumberAction implements ActionListener {@Overridepublic void actionPerformed(ActionEvent e) {JButton jb = (JButton) e.getSource(); // 获取事件源对象String input = jb.getText(); // 获取事件源对象上的标签if (start) { // 首次输入// 一上就".",就什么也不做if (input.equals(".")) {return;}// 如果是"0.0"的话,就清空if (display.getText().equals("0.0")) {display.setText("");}start = false;// 改变是否首次输入的标记值} else {// 判断显示区域的值里面是否已经有".",如果有,输入的又是".",就什么都不做if (display.getText().indexOf(".") != -1) {if (input.equals(".")) {return;}}// 判断显示区域的值里面只有"-",输入的又是".",就什么都不做if (display.getText().equals("-")) {if (input.equals(".")) {return;}}// 判断显示区域的值如果是"0",输入的不是".",就什么也不做if (display.getText().equals("0")) {if (!input.equals(".")) {return;}}}// 如果我点击了运算符以后,再输入数字的话,就要清空显示区域的值if (flag) {display.setText("");flag = false;// 还原初始值,不需要清空}display.setText(display.getText() + input);// 设置显示区域的值}}// 运算符**器private class CommandAction implements ActionListener {@Overridepublic void actionPerformed(ActionEvent e) {JButton jb = (JButton) e.getSource(); // 获取事件源对象String inputCommand = jb.getText(); // 获取事件源对象上的标签if (start) {// 首次输入// 一上就是"-"if (inputCommand.equals("-")) {display.setText("-");// 显示区域的内容设置为"-"start = false;// 改变首次输入的标记}} else {if (!flag) {// 如果flag=false不需要清空显示区的值,就调用方法计算calculate(Double.parseDouble(display.getText()));// 保存显示区域的值,并计算}// 保存你点击的运算符lastCommand = inputCommand;flag = true;// 因为我这里已经输入过运算符,}}}// 计算用的方法private void calculate(double x) {if (lastCommand.equals("+")) {result += x;} else if (lastCommand.equals("-")) {result -= x;} else if (lastCommand.equals("*")) {result *= x;} else if (lastCommand.equals("/")) {result /= x;} else if (lastCommand.equals("=")) {result = x;}display.setText("" + result);}}class MyFrameUitl {public static void init(JFrame jFrame, Dimension frameSize, String title,String iconFileName, boolean resizable) {Toolkit tk = Toolkit.getDefaultToolkit(); // 系统工具包,可以读取系统信息Dimension screenSize = tk.getScreenSize();// 获取屏幕大小// 获取宽高int screenWidth = screenSize.width;int screenHeight = screenSize.height;// 找中心点int centerX = screenWidth / 2;int centerY = screenHeight / 2;// 解析窗体大小int frameWidth = frameSize.width;int frameHeight = frameSize.height;// 设置窗体位置jFrame.setBounds(centerX - frameWidth / 2, centerY - frameHeight / 2,frameWidth, frameHeight);jFrame.setTitle(title);// 设置标题if (iconFileName != null) {jFrame.setIconImage(tk.getImage(iconFileName));// 设置图标}// 设置皮肤com.sun.java.swing.plaf.windows.WindowsLookAndFeel/**/try {UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");SwingUtilities.updateComponentTreeUI(jFrame);} catch (Exception e1) {e1.printStackTrace();}jFrame.setResizable(resizable);// 设置窗体是否可以改变大小jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // 设置程序关闭动作jFrame.setVisible(true);// 显示窗体}}class CalculatorFrame extends JFrame {public CalculatorFrame() {add(new CalculatorPanel());MyFrameUitl.init(this, new Dimension(400, 300), "简易计算器", null,false);this.pack();// 让组件按原始大小显示,并且窗体的大小刚好能够容纳所有的组件}}public class CalculatorTest {public static void main(String args) {new CalculatorFrame();}}

运行结果:

关于本次科学计算器dy570和卡西欧计算器怎么关机的问题分享到这里就结束了,如果解决了您的问题,我们非常高兴。

科学计算器dy570(卡西欧计算器怎么关机)

本文编辑:admin

更多文章:


iphonese2022是双卡吗?新苹果se是不是比OPPO Find X2 pro更好

iphonese2022是双卡吗?新苹果se是不是比OPPO Find X2 pro更好

各位老铁们,大家好,今天由我来为大家分享新款se,以及iphonese2022是双卡吗的相关问题知识,希望对大家有所帮助。如果可以帮助到大家,还望关注收藏下本站,您的支持是我们最大的动力,谢谢大家了哈,下面我们开始吧!本文目录iphones

2023年11月24日 22:10

惠普1108硒鼓(hp p1108硒鼓接触点无法归位)

惠普1108硒鼓(hp p1108硒鼓接触点无法归位)

其实惠普1108硒鼓的问题并不复杂,但是又很多的朋友都不太了解hp p1108硒鼓接触点无法归位,因此呢,今天小编就来为大家分享惠普1108硒鼓的一些知识,希望可以帮助到大家,下面我们一起来看看这个问题的分析吧!本文目录hp p1108硒鼓

2024年5月8日 11:50

网卡驱动win10(Win10网卡驱动检测不到的解决方法)

网卡驱动win10(Win10网卡驱动检测不到的解决方法)

本文目录Win10网卡驱动检测不到的解决方法新装win10没有网卡驱动win10安装网卡驱动找不到网卡或深度睡眠Win10网卡驱动检测不到的解决方法   如今Win10预览版的用户有时候会遇到电脑提示网卡驱动不能用的情况,Win10网

2023年9月14日 08:00

机箱一线品牌(组装电脑,哪些一线品牌)

机箱一线品牌(组装电脑,哪些一线品牌)

大家好,机箱一线品牌相信很多的网友都不是很明白,包括组装电脑,哪些一线品牌也是一样,不过没有关系,接下来就来为大家分享关于机箱一线品牌和组装电脑,哪些一线品牌的一些知识点,大家可以关注收藏,免得下次来找不到哦,下面我们开始吧!本文目录组装电

2024年7月22日 07:19

苹果ipad3和mini2哪个好(苹果ipad3和mini2哪个好)

苹果ipad3和mini2哪个好(苹果ipad3和mini2哪个好)

本文目录苹果ipad3和mini2哪个好ipad3和ipad mini 2哪个好ipad3和ipadmini2哪个好iPad3和mini2选哪个ipad3和ipad mini2到底哪个好呢希望各位大哥大姐给我介绍介绍呗苹果ipad3和min

2023年9月2日 12:40

华为mate40首发(华为Mate40首发!麒麟9000曝光:配备24核GPU)

华为mate40首发(华为Mate40首发!麒麟9000曝光:配备24核GPU)

本文目录华为Mate40首发!麒麟9000曝光:配备24核GPU不受美国影响!华为Mate40将如期发售:首发麒麟1020华为 Mate40系列发布会什么时候开始华为Mate40首发!麒麟9000曝光:配备24核GPU ----------

2023年10月14日 06:10

政府全部换国产电脑品牌有哪些(联想之后,哪个品牌(厂商)能扛起国产电脑的大旗)

政府全部换国产电脑品牌有哪些(联想之后,哪个品牌(厂商)能扛起国产电脑的大旗)

大家好,政府全部换国产电脑品牌有哪些相信很多的网友都不是很明白,包括联想之后,哪个品牌(厂商)能扛起国产电脑的大旗也是一样,不过没有关系,接下来就来为大家分享关于政府全部换国产电脑品牌有哪些和联想之后,哪个品牌(厂商)能扛起国产电脑的大旗的

2024年2月24日 18:50

h3c24口千兆poe交换机(连地下室四层别墅,用一台16路交换机好还是用一台四路和四台四路交换机更合理)

h3c24口千兆poe交换机(连地下室四层别墅,用一台16路交换机好还是用一台四路和四台四路交换机更合理)

大家好,关于h3c24口千兆poe交换机很多朋友都还不太明白,不过没关系,因为今天小编就来为大家分享关于连地下室四层别墅,用一台16路交换机好还是用一台四路和四台四路交换机更合理的知识点,相信应该可以解决大家的一些困惑和问题,如果碰巧可以解

2024年7月14日 22:50

vivos7上市的时间和价格(vivos7和iqooz6哪个好)

vivos7上市的时间和价格(vivos7和iqooz6哪个好)

各位老铁们,大家好,今天由我来为大家分享vivos7上市的时间和价格,以及vivos7和iqooz6哪个好的相关问题知识,希望对大家有所帮助。如果可以帮助到大家,还望关注收藏下本站,您的支持是我们最大的动力,谢谢大家了哈,下面我们开始吧!本

2024年9月23日 00:10

三星c3050开机进不了系统怎么办?三星C3050如何用数据线下载歌曲呀

三星c3050开机进不了系统怎么办?三星C3050如何用数据线下载歌曲呀

各位老铁们好,相信很多人对c3050都不是特别的了解,因此呢,今天就来为大家分享下关于c3050以及三星c3050开机进不了系统怎么办的问题知识,还望可以帮助大家,解决大家的一些困惑,下面一起来看看吧!本文目录三星c3050开机进不了系统怎

2024年8月4日 01:20

页面设置在哪里(wps文档页面设置在哪(wps里的页面设置在哪里))

页面设置在哪里(wps文档页面设置在哪(wps里的页面设置在哪里))

其实页面设置在哪里的问题并不复杂,但是又很多的朋友都不太了解wps文档页面设置在哪(wps里的页面设置在哪里),因此呢,今天小编就来为大家分享页面设置在哪里的一些知识,希望可以帮助到大家,下面我们一起来看看这个问题的分析吧!本文目录wps文

2024年7月16日 06:37

三洋滚筒洗衣机使用说明(三洋洗衣机怎么使用 怎么使用三洋洗衣机)

三洋滚筒洗衣机使用说明(三洋洗衣机怎么使用 怎么使用三洋洗衣机)

大家好,今天小编来为大家解答以下的问题,关于三洋滚筒洗衣机使用说明,三洋洗衣机怎么使用 怎么使用三洋洗衣机这个很多人还不知道,现在让我们一起来看看吧!本文目录三洋洗衣机怎么使用 怎么使用三洋洗衣机三洋 dg-f60311bcg 滚筒洗衣机怎

2024年9月14日 23:50

5800x跑分(5800配了一台电脑,鲁大师跑分25万,算不算好)

5800x跑分(5800配了一台电脑,鲁大师跑分25万,算不算好)

本文目录5800配了一台电脑,鲁大师跑分25万,算不算好5700g cpu部分比5800x差多少王思聪电脑的配件到底有多牛,能跑分世界第四AMD+R9+5800X+Intel+i7+10700k+i9+10900k哪个好5800x频率4.6

2024年7月15日 22:58

vsonic nano(ipod nano6配什么耳机好 价格在 300元 以内的)

vsonic nano(ipod nano6配什么耳机好 价格在 300元 以内的)

本文目录ipod nano6配什么耳机好 价格在 300元 以内的大家推荐一下适合14岁男孩的MP3/MP4, 注重音质价格在1500左右或一下尤尼克斯nanopreme怎么样ipod nano6配什么耳机好 价格在 300元 以内的你是喜

2023年9月17日 19:30

谷歌身份验证器下载app安卓手机(如何重置谷歌身份验证器)

谷歌身份验证器下载app安卓手机(如何重置谷歌身份验证器)

大家好,关于谷歌身份验证器下载app安卓手机很多朋友都还不太明白,不过没关系,因为今天小编就来为大家分享关于如何重置谷歌身份验证器的知识点,相信应该可以解决大家的一些困惑和问题,如果碰巧可以解决您的问题,还望关注下本站哦,希望对各位有所帮助

2024年3月11日 17:00

近期文章

本站热文

标签列表

热门搜索