SWT计算器(加强版)汇率器.doc
上传人:sy****28 上传时间:2024-09-14 格式:DOC 页数:10 大小:85KB 金币:16 举报 版权申诉
预览加载中,请您耐心等待几秒...

SWT计算器(加强版)汇率器.doc

SWT计算器(加强版)汇率器.doc

预览

在线预览结束,喜欢就下载吧,查找使用更方便

16 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

下面是实现的代码,没有背景,大家可以自己添加,还可以实现其他功能。packagelpdswt1;importorg.eclipse.jface.dialogs.MessageDialog;importorg.eclipse.swt.widgets.Combo;importorg.eclipse.swt.widgets.Display;importorg.eclipse.swt.widgets.Label;importorg.eclipse.swt.widgets.Shell;importorg.eclipse.swt.widgets.Text;importorg.eclipse.swt.SWT;importorg.eclipse.swt.widgets.Button;importorg.eclipse.swt.events.SelectionAdapter;importorg.eclipse.swt.events.SelectionEvent;importorg.eclipse.swt.widgets.List;importjava.io.BufferedReader;importjava.io.BufferedWriter;importjava.io.FileReader;importjava.io.FileWriter;importjava.io.IOException;importjava.util.*;publicclassssss{protectedstaticShellshell;privatestaticListlist;//容器list框privatestaticTextimportText1,importText2,fruitText;//输入框1,输入框2,结果框privatestaticComboalgorithmCombo;//下拉框(运算)privatestaticButtonbtnCheckButton,btnCheckButton_1,btnCheckButton_2;//分别+0.1,0.01,0.001privatestaticButtonbtnRadioButton,button_1;//变为正数,变为负数;privatestaticButtonmemoryButton,resultButton1,resultButton2,deleteButton,countButton;//分别是记忆,结果1,结果2,删除,计算privatestaticButtonkeepButton,fetchButton;//存档和读取按钮;privatestaticArrayList<String>la=newArrayList<String>();//一个新的容器privatestaticStrings;//变量,用来做比较privatestaticDoubleoutput,input1,input2;//变量,用来运算privatestaticButtonopenButton;//打开新窗口的按钮protectedstaticShellshell1;//从原有窗口中打开的一个新窗口,而且实现,此窗口不关闭的情况下,无法对原窗口进行控制privatestaticDisplaydisplay=Display.getDefault();privatestaticTextfruitText1,yearText,rateText;//分别是结果框,年数,利率框privatestaticButtonbyeButton,equalButton;//运算符和等号publicstaticvoidmain(String[]args){try{sssswindow=newssss();window.open();}catch(Exceptione){e.printStackTrace();}}publicvoidopen(){createContents();shell.open();shell.layout();while(!shell.isDisposed()){if(!display.readAndDispatch()){display.sleep();}}while(!shell1.isDisposed()){if(!display.readAndDispatch()){display.sleep();}}}//个个变量protect