【Java精品源码栏目提醒】:网学会员为广大网友收集整理了,计算器界面Java编程 - 其它资料,希望对大家有所帮助!
计算机界面 Java 编程实现结果:代码:import java.awt.import javax.swing.public class jisuanqi extends JFrame public jisuanqi JPanel p1new JPanel p1.setLayoutnew GridLayout511 JButton j1 new JButtonSta j1.setBackgroundColor.white j1.setForegroundColor.blue p1.addj1 JButton j2 new JButtonF-E j2.setBackgroundColor.white j2.setForegroundColor.magenta p1.addj2 JButton j3 new JButton j3.setBackgroundColor.white j3.setForegroundColor.magenta p1.addj3 JButton j4 new JButton j4.setBackgroundColor.white j4.setForegroundColor.magenta p1.addj4 JButton j5 new JButtonMC j5.setBackgroundColor.white j5.setForegroundColor.red p1.addj5 JButton j6 new JButton7 j6.setBackgroundColor.white j6.setForegroundColor.bluep1.addj6JButton j7 new JButton8j7.setBackgroundColor.whitej7.setForegroundColor.bluep1.addj7JButton j8 new JButton9j8.setBackgroundColor.whitej8.setForegroundColor.bluep1.addj8JButton j9 new JButton/j9.setBackgroundColor.whitej9.setForegroundColor.redp1.addj9JButton j10 new JButtonModj10.setBackgroundColor.whitej10.setForegroundColor.redp1.addj10JButton j11 new JButtonAndj11.setBackgroundColor.whitej11.setForegroundColor.redp1.addj11JButton j12 new JButtonAvej12.setForegroundColor.darkGrayj12.setEnabledfalsep1.addj12JButton j13 new JButtondmsj13.setBackgroundColor.whitej13.setForegroundColor.magentap1.addj13JButton j14 new JButtonExpj14.setBackgroundColor.whitej14.setForegroundColor.magentap1.addj14JButton j15 new JButtonlnj15.setBackgroundColor.whitej15.setForegroundColor.magentap1.addj15JButton j16 new JButtonMRj16.setBackgroundColor.whitej16.setForegroundColor.redp1.addj16JButton j17 new JButton4j17.setBackgroundColor.whitej17.setForegroundColor.bluep1.addj17JButton j18 new JButton5j18.setBackgroundColor.whitej18.setForegroundColor.bluep1.addj18JButton j19 new JButton6j19.setBackgroundColor.whitej19.setForegroundColor.bluep1.addj19JButton j20 new JButtonj20.setBackgroundColor.whitej20.setForegroundColor.redp1.addj20JButton j21 new JButtonOrj21.setBackgroundColor.whitej21.setForegroundColor.redp1.addj21JButton j22 new JButtonXorj22.setBackgroundColor.whitej22.setForegroundColor.redp1.addj22JButton j23 new JButtonSumj23.setForegroundColor.darkGrayj23.setEnabledfalsep1.addj23JButton j24 new JButtonsinj24.setBackgroundColor.whitej24.setForegroundColor.magentap1.addj24JButton j25 new JButtonxyj25.setBackgroundColor.whitej25.setForegroundColor.magentap1.addj25JButton j26 new JButtonlogj26.setBackgroundColor.whitej26.setForegroundColor.magenta p1.addj26JButton j27 new JButtonMSj27.setBackgroundColor.whitej27.setForegroundColor.redp1.addj27JButton j28 new JButton1j28.setBackgroundColor.whitej28.setForegroundColor.bluep1.addj28JButton j29 new JButton2j29.setBackgroundColor.whitej29.setForegroundColor.bluep1.addj29JButton j30 new JButton3j30.setBackgroundColor.whitej30.setForegroundColor.bluep1.addj30JButton j31 new JButton-j31.setBackgroundColor.whitej31.setForegroundColor.redp1.addj31JButton j32 new JButtonLshj32.setBackgroundColor.whitej32.setForegroundColor.redp1.addj32JButton j33 new JButtonNotj33.setBackgroundColor.whitej33.setForegroundColor.redp1.addj33JButton j34 new JButtonsj34.setForegroundColor.darkGrayj34.setEnabledfalsep1.addj34JButton j35 new JButtoncosj35.setBackgroundColor.whitej35.setForegroundColor.magenta p1.addj35JButton j36 new JButtonx3j36.setBackgroundColor.whitej36.setForegroundColor.magenta p1.addj36JButton j37 new JButtonnj37.setBackgroundColor.whitej37.setForegroundColor.magenta p1.addj37JButton j38 new JButtonMj38.setBackgroundColor.whitej38.setForegroundColor.redp1.addj38JButton j39 new JButton0j39.setBackgroundColor.whitej39.setForegroundColor.bluep1.addj39JButton j40 new JButton/-j40.setBackgroundColor.whitej40.setForegroundColor.bluep1.addj40JButton j41 new JButton.j41.setBackgroundColor.whitej41.setForegroundColor.bluep1.addj41JButton j42 new JButtonj42.setBackgroundColor.whitej42.setForegroundColor.redp1.addj42JButton j43 new JButtonj43.setBackgroundColor.whitej43.setForegroundColor.redp1.addj43JButton j44 new JButtonIntj44.setBackgroundColor.whitej44.setForegroundColor.redp1.addj44JButton j45 new JButtonDatj45.setForegroundColor.darkGrayj45.setEnabledfalsep1.addj45JButton j46 new JButtontanj46.setBackgroundColor.whitej46.setForegroundColor.magenta p1.addj46JButton j47 new JButtonx2j47.setBackgroundColor.whitej47.setForegroundColor.magenta p1.addj47JButton j48 new JButton1/xj48.setBackgroundColor.whitej48.setForegroundColor.magenta p1.addj48JButton j49 new JButtonpij49.setBackgroundColor.whitej49.setForegroundColor.bluep1.addj49JButton j50 new JButtonAj50.setForegroundColor.darkGrayj50.setEnabledfalsep1.addj50JButton j51 new JButtonBj51.setForegroundColor.darkGrayj51.setEnabledfalsep1.addj51JButton j52 new JButtonCj52.setForegroundColor.darkGrayj52.setEnabledfalsep1.addj52JButton j53 new JButtonDj53.setForegroundColor.darkGrayj53.setEnabledfalsep1.addj53JButton j54 new JButtonEj54.setForegroundColor.darkGrayj54.setEnabledfalsep1.addj54JButton j55 new JButtonFj55.setForegroundColor.darkGrayj55.setEnabledfalsep1.addj55addp1BorderLayout.SOUTHJPanel p2 new JPanelnew BorderLayoutp2.addnew JTextField0.BorderLayout.NORTHaddp2BorderLayout.NORTHJPanel p3 new JPanelp3.setLayoutnew GridLayout2355p3.addnew JRadioButton角度p3.addnew JRadioButton弧度p3.addnew JRadioButton梯度JButton i1 new JButtonBackspacei1.setBackgroundColor.whitei1.setForegroundColor.redp3.addi1JButton i2 new JButtonCEi2.setBackgroundColor.whitei2.setForegroundColor.redp3.addi2JButton i3 new JButtonCi3.setBackgroundColor.whitei3.setForegroundColor.red p3.addi3 addp3BorderLayout.EAST JPanel p4 new JPanel p4.setLayoutnew GridLayout2433 p4.addnew JRadioButton十六进制 p4.addnew JRadioButton十进制 p4.addnew JRadioButton八进制 p4.addnew JRadioButton二进制 p4.addnew JCheckBoxInv p4.addnew JCheckBoxHyp JButton k1 new JButton k1.setEnabledfalse p4.addk1 JButton k2 new JButton k2.setEnabledfalse p4.addk2 addp4BorderLayout.WEST public static void mainString args // TODO Auto-generated method stub jisuanqi framenew jisuanqi frame.setTitle计算器 frame.setSize680250 frame.setLocationRelativeTonull frame.setDefaultCloseOperationJFrame.EXIT_ON_CLOSE frame.setVisibletrue