www.ylrr.net > 用JAvA设计一个图形界面(GUI)的计算器应用程序,完成简单的算术运算

用JAvA设计一个图形界面(GUI)的计算器应用程序,完成简单的算术运算

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

import java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextField;

package com; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Calculator extends JFrame implements ActionListener{ private static final long serialVersionUID = 8199443193151152362L; private JButton bto_s=new

package test2; import java.awt.*; import javax.swing.*; import java.awt.event.*; class Counter extends WindowAdapter { static JFrame f=new JFrame("计算器"); static JTextField text1=new JTextField("0."); static String source="";

期待看到有用的回答!

#includeusing namespace std;void compute(){ for(int i = 0; i 评论0 0 0

Calculator.javapublic class Calculator{private String result = "0";private int op = 0,add = 1,sub = 2,mul = 3,div = 4;private double stringToDouble(String x){double y = Double.parseDouble(x);return y;}private void operate(String x){double x1 =

import java.awt.*;import java.awt.event.*;public class jisuanqi extends WindowAdapter { Panel p1 = new Panel(); Panel p2 = new Panel(); Panel p3 = new Panel(); TextField txt; private Button[] b = new Button[17]; private String ss[] = { "7", "8",

下面的例子实现了界面,你可以实现ActionListener接口,为对应按钮添加事件,实现计算器的计算功能!~import java.awt.BorderLayout;import java.awt.Container;import java.awt.GridBagConstraints;import java.awt.GridBagLayout;import java.awt

/** @version 1.32 2004-05-05 @author Cay Horstmann */ import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Calculator { public static void main(String[] args) { CalculatorFrame frame = new CalculatorFrame(); frame.

相关搜索:

网站地图

All rights reserved Powered by www.ylrr.net

copyright ©right 2010-2021。
www.ylrr.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com