ImageVerifierCode 换一换
格式:DOCX , 页数:24 ,大小:18.07KB ,
资源ID:15300339      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/15300339.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(计算器代码Word文件下载.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

计算器代码Word文件下载.docx

1、private JButton dian=new JButton(.private JButton kai=new JButton(sqrtprivate JButton diao=new JButton(1/xprivate JButton aa=new JButton(Aprivate JButton bb=new JButton(Bprivate JButton cc=new JButton(Cprivate JButton dd=new JButton(Dprivate JButton ee=new JButton(Eprivate JButton ff=new JButton(Fpr

2、ivate TextField k1=new TextField();private objConversion convert = new objConversion();JMenuItem copy,paste,s,t,about,me;JRadioButton sixteen,ten,eight,two;JButton backspace,ce,num0,num1,num2,num3,num4,num5,num6,num7,num8,num9;Container cp;JTextField text;String copycontent=;boolean clickable=true,c

3、lear=true;int all=0;double qian;String fuhao;int jin=10,first=1;public calculator()setTitle(计算器李铀制作setSize(400,300);setLocation(250,200);text=new JTextField(25);text.setText(0.text.setHorizontalAlignment(JTextField.RIGHT);JPanel cp1=new JPanel();JPanel cp2=new JPanel();JPanel cp3=new JPanel();cp=get

4、ContentPane();cp.add(cp1,Northcp.add(cp2,Centercp.add(cp3,Southcp1.setLayout(new GridLayout(1,6);cp2.setLayout(new GridLayout(2,4);cp3.setLayout(new GridLayout(6,6);sixteen=new JRadioButton(十六进制sixteen.setVisible(false);ten=new JRadioButton(十进制,true);ten.setVisible(false);eight=new JRadioButton(八进制e

5、ight.setVisible(false);two=new JRadioButton(二进制two.setVisible(false);sixteen.addActionListener(this);ten.addActionListener(this);eight.addActionListener(this);two.addActionListener(this);ButtonGroup btg=new ButtonGroup();btg.add(sixteen);btg.add(ten);btg.add(eight);btg.add(two);JTextField t3=new JTe

6、xtField(25);cp1.add(text);text.setEditable(false);text.setBackground(new Color(255, 255, 255);cp2.add(sixteen);cp2.add(ten);cp2.add(eight);cp2.add(two);backspace=new JButton(Backspacebackspace.setForeground(new Color(255,0,0);backspace.addActionListener(this);ce=new JButton(CEce.setForeground(new Co

7、lor(255,0,0);ce.addActionListener(this);k1.setVisible(false);cp2.add(k1);cp2.add(backspace);cp2.add(ce);num0=new JButton(0num1=new JButton(1num2=new JButton(2num3=new JButton(3num4=new JButton(4num5=new JButton(5num6=new JButton(6num7=new JButton(7num8=new JButton(8num9=new JButton(9cp3.add(num7);nu

8、m7.addActionListener(this);cp3.add(num8);num8.addActionListener(this);cp3.add(num9);num9.addActionListener(this);cp3.add(chu);chu.setForeground(new Color(255,0,0);chu.addActionListener(this);cp3.add(kai);kai.addActionListener(this);cp3.add(num4);num4.addActionListener(this);cp3.add(num5);num5.addAct

9、ionListener(this);cp3.add(num6);num6.addActionListener(this);cp3.add(cheng);cheng.setForeground(new Color(255,0,0);cheng.addActionListener(this);cp3.add(qiuyi);qiuyi.addActionListener(this);cp3.add(num1);num1.addActionListener(this);cp3.add(num2);num2.addActionListener(this);cp3.add(num3);num3.addAc

10、tionListener(this);cp3.add(jian);jian.setForeground(new Color(255,0,0);jian.addActionListener(this);cp3.add(diao);diao.addActionListener(this);cp3.add(num0);num0.addActionListener(this);cp3.add(fu);fu.addActionListener(this);cp3.add(dian);dian.addActionListener(this);cp3.add(jia);jia.setForeground(n

11、ew Color(255,0,0);jia.addActionListener(this);cp3.add(deng);deng.setForeground(new Color(255,0,0);deng.addActionListener(this);cp3.add(aa);aa.addActionListener(this);cp3.add(bb);bb.addActionListener(this);cp3.add(cc);cc.addActionListener(this);cp3.add(dd);dd.addActionListener(this);cp3.add(ee);ee.ad

12、dActionListener(this);cp3.add(ff);ff.addActionListener(this);aa.setVisible(false);bb.setVisible(false);cc.setVisible(false);dd.setVisible(false);ee.setVisible(false);ff.setVisible(false);JMenuBar mainMenu = new JMenuBar();setJMenuBar(mainMenu);JMenu editMenu = new JMenu(编辑JMenu viewMenu = new JMenu(

13、查看JMenu helpMenu = new JMenu(帮助mainMenu.add(editMenu);mainMenu.add(viewMenu);mainMenu.add(helpMenu);copy = new JMenuItem( 复制paste = new JMenuItem( 粘贴KeyStroke copyks=KeyStroke.getKeyStroke(KeyEvent.VK_C,Event.CTRL_MASK);copy.setAccelerator(copyks);KeyStroke pasteks=KeyStroke.getKeyStroke(KeyEvent.VK_V,Event.CTRL_MASK);paste.setAccelerator(pasteks);/设置退出菜单选项加上快捷键editMenu.add(copy);editMenu.add(paste);copy.addActionListener(this);paste.addActio

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1