www.rlmx.net > jAvA 计算器

jAvA 计算器

下面文件名要为:JiSuanQi.java import java.awt.*; import java.awt.event.*; public class JiSuanQi { String s="",s1=null,s2=null; Frame f=new Frame("计算器"); TextField tf=new TextField(30); Panel p1=new Panel(); Panel p2=new Pane...

是用awt和swing做的,很好看比单单用AWT做好看 import java.awt.*; import javax.swing.*; public class Conputer extends JFrame { protected Container con = getContentPane();// 指向内容面板 protected JMenuBar a = new JMenuBar();// 菜...

public class SanJiao {public static void main(String[] args) {double a = Math.toRadians(90);//把数字90 转换成 90度System.out.println(Math.sin(a));//计算sin 90度double b = Math.toRadians(30);System.out.println(Math.cos(b));doubl...

/* * @(#)JCalculator.java 1.00 12/29/2009 * * Email: light_warm@163.com */ 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 frie...

打开IED:打开自己java编程的软件,采用的是eclipse软件。 建立java工程。 编写类。 编写类的详细步骤1.类的基本结构: 由于这里用到了界面,所以要进行窗口界面的编程,按钮事件的处理,和计算处理界面; package MyCaculator; import java.awt...

正方形的,实现数字加、减、乘、除四则运算。 import java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.text.DecimalFormat; import javax.swing.JBut...

public class Calculator { private int number1; private int number2; public Calculator(int number1, int number2) { this.number1 = number1; this.number2 = number2; } public double add() { return number1 + number2; } public double...

class CalcBtn extends JButton { private static final long serialVersionUID = 1L; Font font = new Font("仿宋", 1, 22); public CalcBtn(String text, Color color) { super(text); setForeground(color); setFont(font); setMargin(new In...

//声明需要插入的包import java.awt.*;import java.lang.Object; import java.lang.String;import javax.swing.*;import java.awt.event.*;import java.awt.TextComponent;//声明一个主类jisuanqi,继续窗口类Framepublic class jisuanqi extend...

这是去年我的期末作业,发给你吧。 import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.*; public class Calculate extends JFrame { private String front = "", behind = ""; //分别用于记录加减乘除运算符之...

网站地图

All rights reserved Powered by www.rlmx.net

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