yhkn.net
当前位置:首页 >> 用JAvA设计一个简单的计算器. >>

用JAvA设计一个简单的计算器.

下午发 五分钟搞定,先给你发个简单的,照例子自己去做你想要的计算器 package aaa; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class YunSuan implements ActionListener,ItemListener { public static JFrame...

然后 通过输入 显示结果,比如说: 以下是上图计算器的代码: package Computer; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Font; import java.awt.GridLayout; import java.awt.event...

我写了个整数可以使用的, 你可以研究一下, 添入小数部分 功能和window7自带的那个一样 import java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.sw...

无聊写了个,修复了下Bug: import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.J...

/* * @(#)JCalculator.java 1.00 06/17/2015 */ import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * A simple calculator program. * I saw this program in a QQ group, and help a friend correct it. * * @author Sin...

import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.sw...

public static void main(String[] args) {int one = 1;int two = 2;String mark = "--";calc(one, mark, two);//如果为递加或递减的情况,请注意传参顺序}public static void calc(int one, String mark, int two) {int result = 0;switch (mar...

#include int main( ) { double a, b; char op; scanf("%lf%c%lf", &a, &op, &b); switch (op) { case '+': printf("%lf + %lf = %lf\n", a, b, a + b); break; case '-': printf("%lf - %lf = %lf\n", a, b, a - b); break; case '*': printf("...

import java.awt.*; import java.awt.event.*; public class CalcAppDemo extends Frame{ private TextField t_result; private Panel p_main; //主面板 private Panel p_num; //数字面板 private Panel p_oper; //操作符面板 private Panel p_s...

import sun.plugin.security.Broken11ClassFixer; import java.awt.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JFrame; import java.awt.FlowLayou...

网站首页 | 网站地图
All rights reserved Powered by www.yhkn.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com