资源简介
JAVA计算器小程序(多进制计算、转换)
包含 2进制 8进制 10进制 16进制数的计算,转换
代码片段和文件信息
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.lang.*;
public class SZJSQ extends Japplet implements ActionListener
{
String lineTag=“D:“;
boolean i=true;
int flag = 0tflag = 0;
int transfer = 0;
int tf=0;
private JButton binary = new JButton(“二进制“);
private JButton octal = new JButton(“八进制“);
private JButton decimal = new JButton(“十进制“);
private JButton hexa = new JButton(“十六进制“);
private JButton num0=new JButton(“0“);
private JButton num1=new JButton(“1“);
private JButton num2=new JButton(“2“);
private JButton num3=new JButton(“3“);
private JButton num4=new JButton(“4“);
private JButton num5=new JButton(“5“);
private JButton num6=new JButton(“6“);
private JButton num7=new JButton(“7“);
private JButton num8=new JButton(“8“);
private JButton num9=new JButton(“9“);
private JButton numA=new JButton(“A“);
private JButton numB=new JButton(“B“);
private JButton numC=new JButton(“C“);
private JButton numD=new JButton(“D“);
private JButton numE=new JButton(“E“);
private JButton numF=new JButton(“F“);
private JButton zuok=new JButton(“(“);
private JButton youk=new JButton(“)“);
private JButton dian=new JButton(“.“);
private JButton NULL=new JButton(“转换“);
private JButton plu=new JButton(“+“);
private JButton min=new JButton(“-“);
private JButton mul=new JButton(“x“);
private JButton div=new JButton(“/“);
private JButton equ=new JButton(“=“);
private JButton cle=new JButton(“c“);//清除
private JTextField space=new JTextField(40);
public void init()
{
JPanel text=new JPanel();
text.setLayout(new FlowLayout());
text.add(space);
JPanel buttons=new JPanel();
buttons.setLayout(new GridLayout(65));
buttons.add(binary);
buttons.add(octal);
buttons.add(decimal);
buttons.add(hexa);
buttons.add(NULL);
buttons.add(numA);
buttons.add(numB);
buttons.add(numC);
buttons.add(zuok);
buttons.add(youk);
buttons.add(numD);
buttons.add(numE);
buttons.add(numF);
buttons.add(plu);
buttons.add(min);
buttons.add(num9);
buttons.add(num8);
buttons.add(num7);
buttons.add(mul);
buttons.add(div);
buttons.add(num6);
buttons.add(num5);
buttons.add(num4);
buttons.add(dian);
buttons.add(cle);
buttons.add(num3);
buttons.add(num2);
buttons.add(num1);
buttons.add(num0);
buttons.add(equ);
(binary).addActionListener(this);
(octal).addActionListener(this);
(decimal).addActionListener(this);
(hexa).addActionListener(this);
(numA).addActionListener(this);
(numB).addActionListener(this);
(numC).addActionListener(this);
(numD).addActionListener(this);
(numE).addActionListener(this);
(numF).addActionListener(this);
(num9).addActionListener(this);
(num8).addActionListener(this);
(num7).addActionListener(this);
(num6).addActionListener(this);
(num5).addActionListener(this);
- 上一篇:Sun_Java程序员认证考试题库
- 下一篇:Java网络白板197032
相关资源
- Java网络白板197032
- Sun_Java程序员认证考试题库
- MAVEN RSA签名生成验签
- Java编的生日祝福软件源代码
- java+SQL人事管理系统
- java多边形填充扫描线种子算法
- MQTT JAVA jar包 wmqtt.jar
- javajsp网页登陆
- 利用JAVA文件读写流编写的学生点名系
- JAVA课设迷你计算器设计
- 使用jsp+servlet+mysql+tomcat的java web,很简
- word转pdf安装软件
- VB to Java Converter
- 用java求两数之和
- java jdk demo
- java语言银行ATM系统界面实现
- java写的打字游戏源代码
- java初学者练习题
- java 项目答辩-记事本.pptx
- java socket实现的点对点文件传输
- 用Java程序读取Excel表格内容并显示在
- Java火车票查询系统课程设计
- Java火车票查询系统
- java niit在线测试题目
- 基于struts2+spring+hibernate的JavaEE课设
- B树实现的文件索引 java版
- JAVA实现对图片的快速离散傅里叶变换
- 基于JAVA局域网聊天程序设计与实现(
- JavaQQ即时通信系统C/S模式
- 龟兔赛跑JAVA小程序
评论
共有 条评论