欢迎来到天天文库
浏览记录
ID:41037583
大小:56.50 KB
页数:7页
时间:2019-08-14
《计算器界面Java编程》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、计算机界面Java编程实现结果:代码:importjava.awt.*;importjavax.swing.*;publicclassjisuanqiextendsJFrame{publicjisuanqi(){JPanelp1=newJPanel();p1.setLayout(newGridLayout(5,11));JButtonj1=newJButton("Sta");j1.setBackground(Color.white);j1.setForeground(Color.blue);p1.add(j1);JButtonj2=newJButton("F-E");j2.setBa
2、ckground(Color.white);j2.setForeground(Color.magenta);p1.add(j2);JButtonj3=newJButton("(");j3.setBackground(Color.white);j3.setForeground(Color.magenta);p1.add(j3);JButtonj4=newJButton(")");j4.setBackground(Color.white);j4.setForeground(Color.magenta);p1.add(j4);JButtonj5=newJButton("MC");j5.se
3、tBackground(Color.white);j5.setForeground(Color.red);p1.add(j5);JButtonj6=newJButton("7");j6.setBackground(Color.white);j6.setForeground(Color.blue);p1.add(j6);JButtonj7=newJButton("8");j7.setBackground(Color.white);j7.setForeground(Color.blue);p1.add(j7);JButtonj8=newJButton("9");j8.setBackgro
4、und(Color.white);j8.setForeground(Color.blue);p1.add(j8);JButtonj9=newJButton("/");j9.setBackground(Color.white);j9.setForeground(Color.red);p1.add(j9);JButtonj10=newJButton("Mod");j10.setBackground(Color.white);j10.setForeground(Color.red);p1.add(j10);JButtonj11=newJButton("And");j11.setBackgr
5、ound(Color.white);j11.setForeground(Color.red);p1.add(j11);JButtonj12=newJButton("Ave");j12.setForeground(Color.darkGray);j12.setEnabled(false);p1.add(j12);JButtonj13=newJButton("dms");j13.setBackground(Color.white);j13.setForeground(Color.magenta);p1.add(j13);JButtonj14=newJButton("Exp");j14.s
6、etBackground(Color.white);j14.setForeground(Color.magenta);p1.add(j14);JButtonj15=newJButton("ln");j15.setBackground(Color.white);j15.setForeground(Color.magenta);p1.add(j15);JButtonj16=newJButton("MR");j16.setBackground(Color.white);j16.setForeground(Color.red);p1.add(j16);JButtonj17=newJButto
7、n("4");j17.setBackground(Color.white);j17.setForeground(Color.blue);p1.add(j17);JButtonj18=newJButton("5");j18.setBackground(Color.white);j18.setForeground(Color.blue);p1.add(j18);JButtonj19=newJButton("6");j19.setBackground(Color
此文档下载收益归作者所有