2022年java计算器源代码.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《2022年java计算器源代码.docx》由会员分享,可在线阅读,更多相关《2022年java计算器源代码.docx(32页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精品学习资源java 运算器源代码 仿 win7import java.awt.* ;import javax.swing.* ;import java.awt.event.*;class Cal extends JFrame implements ActionListener,MouseListenerJMenuBar menubar ;JMenu menu_check,menu_edit,menu_help;JMenuItem menuitem_science,menuitem_check,menuitem_exit,menuitem_copy,menuitem_paste,menuite
2、m1_copy,menuitem1_paste,menuitem_chelp,menuitem_about;JCheckBoxMenuItem menuitem_standard ;JTextField ta1;int x,result2 ;double op1,op2,opall ;private boolean end=false,flag=false,add=false,sub=false,cheng=false,chu=false,flagop2=false;JButton b_mc,b_mr,b_ms,b_mjia,b_mjian,b_tui,b_ce,b_c,b_jj, b_dui
3、,b_7,b_8,b_9,b_chu,b_baifenhao,b_4,b_5,b_6,b_cheng, b_daoshu,b_1,b_2,b_3,b_jian,b_0,b_dian,b_jia,b_dengyu;JPanel p_all,p_button1,p_button2,p_txt,p1,p2,p3,p4,p5;private String str,resultstr ;JPopupMenu popupmenu ;Container con=this.getContentPane ;Font font=new Font 微软雅黑 ,Font.PLAIN,12;Color color=ne
4、w Color120,220,120 ;欢迎下载精品学习资源CalString ssupers;setSize220,315;setResizablefalse;setVisibletrue ;Dimension scr=Toolkit.getDefaultToolkit.getScreenSize ;Dimension frm=this.getSize ;setLocationscr.width-frm.width/2,scr.height-frm.height/2;Toolkit tk=Toolkit.getDefaultToolkit;/ 程序默认图标设置setIconImagetk.c
5、reateImageD:sd.jpg;setDefaultCloseOperationJFrame.EXIT_ON_CLOSE;/-制作框架结构 -/-菜单栏 -menubar=new JMenuBar ;menubar.setPreferredSizenew Dimensionfrm.width,19;menu_check=new JMenu 查看 V;menu_check.setFontfont ;menu_check.setForegroundColor.black ;menuitem_standard=new JCheckBoxMenuItem标准型 ,true ;menuitem_s
6、tandard.setFontfont;menuitem_standard.setForegroundColor.black;menuitem_science=new JMenuItem科学型 ;menuitem_science.setFontfont ;欢迎下载精品学习资源menuitem_science.setForegroundColor.black ;menuitem_check=new JMenuItem查看分组 ;menuitem_check.setFontfont ;menuitem_check.setForegroundColor.black;menuitem_exit=new
7、 JMenuItem退出;menuitem_exit.setFontfont;menuitem_exit.setForegroundColor.black;menuitem_exit.addActionListenerthis;menu_check.addmenuitem_standard;menu_check.addmenuitem_science ;menu_check.addSeparator ;menu_check.addmenuitem_check ;menu_check.addSeparator ;menu_check.addmenuitem_exit ;menubar.addme
8、nu_check ;menu_edit=new JMenu 编辑 E;menu_edit.setFontfont ;menu_edit.setForegroundColor.black ;menu_edit.setMnemonicKeyEvent.VK_E ;menuitem_copy=new JMenuItem复制 C ;menuitem_copy.setFontfont;menuitem_copy.setForegroundColor.black ;menuitem_copy.setAcceleratorKeyStroke.getKeyStrokeKeyEvent.VK_C,InputEv
9、ent.CTRL_MASK;menuitem_copy.addActionListenerthis;menuitem_paste=new JMenuItem粘贴 P ;menuitem_paste.setFontfont;menuitem_paste.setForegroundColor.black;menuitem_paste.setAcceleratorKeyStroke.getKeyStrokeKeyEvent.VK_V,InputEvent.CTRL_MASK ;欢迎下载精品学习资源menuitem_paste.addActionListenerthis;menu_edit.addme
10、nuitem_copy;menu_edit.addmenuitem_paste;menubar.addmenu_edit ;menu_help=new JMenu 帮忙 H;menu_help.setFontfont ;menu_help.setForegroundColor.black ;menuitem_chelp=new JMenuItem查看帮忙 ;menuitem_chelp.setFontfont;menuitem_chelp.setForegroundColor.black;menuitem_about=new JMenuItem关于运算器 ;menuitem_about.set
11、Fontfont;menuitem_about.setForegroundColor.black;menuitem_about.addActionListenerthis;menu_help.addmenuitem_chelp;menu_help.addSeparator ;menu_help.addmenuitem_about;menubar.addmenu_help ;setJMenuBarmenubar ;/-文本框 -ta1=new JTextField0 ;ta1.setFontnew Font 微软雅黑 ,Font.PLAIN,13;ta1.setEditablefalse ;/t
12、a1.setOpaquefalse ;ta1.setHorizontalAlignmentJTextField.RIGHT ;欢迎下载精品学习资源ta1.setPreferredSizenew Dimensionfrm.width-26,45;ta1.addMouseListenerthis ;p_all=new JPanel;p_all.setPreferredSizenew Dimensionfrm.width-6,250;/p_all.setBackgroundcolor ;p_all.setLayoutnew FlowLayoutFlowLayout.CENTER,0,3 ;p_txt
13、=new JPanel ;p_txt.setPreferredSizenew Dimensionfrm.width-6,53;p_txt.setLayoutnew FlowLayoutFlowLayout.CENTER,0,7 ;p_txt.addta1 ;p_all.addp_txt ;con.addp_all,BorderLayout.CENTER;/-按钮区 -p_button1=new JPanel ;p_button1.setPreferredSizenew Dimensionfrm.width-25,131;p_button1.setLayoutnew FlowLayoutFlow
14、Layout.LEFT,0,3 ;p_all.addp_button1 ;p1=new JPanel;p1.setPreferredSizenew Dimensionfrm.width-25,127;p1.setLayoutnew GridLayout4,5,5,6 ;b_mc=new JButtonMC ;欢迎下载精品学习资源b_mc.setFontnew Font 微软雅黑 ,Font.PLAIN,11;b_mc.setMarginnew Insets0,0,0,0 ;b_mc.setForegroundColor.blue ;b_mc.addActionListenerthis ;b_m
15、r=new JButtonMR ;b_mr.setFontnew Font 微软雅黑 ,Font.PLAIN,11;b_mr.setMarginnew Insets0,0,0,0 ;b_mr.setForegroundColor.blue ;b_mr.addActionListenerthis ;b_ms=new JButtonMS ;b_ms.setFontnew Font 微软雅黑 ,Font.PLAIN,11;b_ms.setMarginnew Insets0,0,0,0 ;b_ms.setForegroundColor.blue ;b_ms.addActionListenerthis
16、;b_mjia=new JButtonM+;b_mjia.setFontnew Font 微软雅黑 ,Font.PLAIN,11;b_mjia.setMarginnew Insets0,0,0,0 ;b_mjia.setForegroundColor.blue ;b_mjia.addActionListenerthis ;b_mjian=new JButtonM-;b_mjian.setFontnew Font 微软雅黑 ,Font.PLAIN,11;b_mjian.setMarginnew Insets0,0,0,0 ;b_mjian.setForegroundColor.blue ;b_m
17、jian.addActionListenerthis ;b_tui=new JButton ;b_tui.setFontnew Font 微软雅黑 ,Font.BOLD,14;b_tui.setMarginnew Insets0,0,0,0 ;b_tui.addActionListenerthis ;b_tui.setForegroundColor.red ;b_ce=new JButtonCE;欢迎下载精品学习资源b_ce.setFontnew Font 微软雅黑 ,Font.PLAIN,11;b_ce.setMarginnew Insets0,0,0,0 ;b_ce.setForegrou
18、ndColor.red ;b_ce.addActionListenerthis ;b_c=new JButtonC ;b_c.setFontnew Font 微软雅黑 ,Font.PLAIN,11;b_c.setMarginnew Insets0,0,0,0 ;b_c.setForegroundColor.red ;b_c.addActionListenerthis ;b_jj=new JButton; b_jj.setFontnew Font 微软雅黑 ,Font.PLAIN,14;b_jj.setMarginnew Insets0,0,0,0 ;b_jj.setForegroundColo
19、r.red ;b_jj.addActionListenerthis ;b_dui=new JButton ;b_dui.setFontnew Font 微软雅黑 ,Font.PLAIN,11;b_dui.setMarginnew Insets0,0,0,0 ;b_dui.setForegroundColor.red ;b_dui.addActionListenerthis ;b_7=new JButton7 ;b_7.setFontnew Font 微软雅黑 ,Font.PLAIN,14 ;b_7.setMarginnew Insets0,0,0,0 ;b_7.setForegroundCol
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022 java 计算器 源代码
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内