自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(2)
  • 资源 (8)
  • 收藏
  • 关注

原创 欢迎使用CSDN-markdown编辑器

MOTChallenge 2015: Towards a Benchmark for Multi-Target Tracking阅读笔记

2016-01-24 15:39:04 1046 1

原创 超像素分割算法

SLIC原理与核心算法1.具体步骤:初始化聚类中心、迭代聚类、 后续加强联通 3)后续加强联通: 在迭代结束时,会有少量的迷失像素,即少量的像素和附近较大的分割块有相同的 标签,但它们并没有被关联进去。因为迭代聚类时没有明确地加强连通性,这种情况就可能发生。因此,我们可以在算法的

2015-05-21 10:29:07 4748 2

MOTChallenge 2015

多目标跟踪评价标准:MOTChallenge 2015,论文加代码 matlab

2017-12-01

Image-to-Image Translation with Conditional Adversarial Networks

Image-to-Image Translation with Conditional Adversarial Networks论文加代码,python(tensorflow)实现和lua实现

2017-12-01

matconvnet卷积神经网络的手册

matconvnet卷积神经网络的手册. CNN最近非常火,这是一个2012年在imagenet挑战赛上获得冠军的网络。本人也在使用,很好用,适合于图像分类检索等。

2016-01-24

多目标跟踪MOT 论文加代码

2015 cvpr上的一篇顶尖论文加源代码,关于多目标跟踪的。

2015-11-09

车牌识别源码

非常准确的一个车牌识别代码,可以直接运行,有数据集

2015-11-09

软件工程实验—Rational_Rose_2003

rose2003 各类图介绍,各种突变介绍。

2013-04-09

Java:二进制方式读取文件

package hustspy.encrypt; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class FileOperation { public static void main(String[] args) { String src = "111.txt"; String dec = "222.txt"; try { FileInputStream in = new FileInputStream(src); // File file = new File&#40;dec&#41;; // if(!file.exists()) // file.createNewFile&#40;&#41;; FileOutputStream out = new FileOutputStream(dec); byte buffer[] = new byte[1024]; int count,i; while((count=in.read(buffer))!=-1){ // for循环保证只写入count个byte, 否则会写入1024个byte for(i=0; i<count; i++){ out.write(buffer[i]); } } in.close(); out.close(); System.out.println("Success!"); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }

2012-10-16

java计算器程序.doc

java 编写计算器的简单程序//一个较为简洁的巧妙的计算器程序, import java.io.*; import java.awt.event.*; import java.awt.*; //需要解决的问题,数学的运算都有正负号的出现,在点击等号的时候就会有冲突,应该怎样解决,经验:双精度浮点型数据类型是会像后减一位。0.7会显示成0.69999999 public class app74 { static int i=0; static int j=0; static int k=-1; static int l=-1; //static int Data1[]={1}; static String str9=""; static Frame frm1=new Frame("计算器"); static Button btn1=new Button("1"); static Button btn2=new Button("2"); static Button btn3=new Button("3"); static Button btn5=new Button("4"); static Button btn6=new Button("5"); static Button btn7=new Button("6"); static Button btn9=new Button("7"); static Button btn14=new Button("8"); static Button btn16=new Button("9"); static Button btn11=new Button("0");//数字0 static Button btn4=new Button("."); static Button btn8=new Button("+"); static Button btn10=new Button("-"); static Button btn15=new Button("*"); static Button btn13=new Button("/"); static Button btn20=new Button("="); static Button btn18=new Button("清零"); static Button btn19=new Button("后退"); static Button btn12=new Button("π"); static Button btn17=new Button("颜色"); static TextField TF1=new TextField(); static Label Lb1=new Label(".0",Label.RIGHT); //标签 static Label Lb2=new Label(".0",Label.RIGHT); //BS字符长度 static Label Lb3=new Label(".0",Label.RIGHT); //对象str22字符长度 static Label Lb4=new Label(".0",Label.RIGHT); //BS剩余字符长度字符长度 static Label Lb5=new Label("无",Label.LEFT); //执行错误抛出 static Label Lb6=new Label("对象BS字符长度 : ",Label.LEFT); static Label Lb7=new Label("对象str22字符长度 :",Label.LEFT); static Label Lb8=new Label("对象BS剩余字符长度:",Label.LEFT); static Label Lb9=new Label("错误:",Label.LEFT); static Label Lb10=new Label(".0",Label.RIGHT); //计算器下面的标签 static Label Lb11=new Label("余数:",Label.RIGHT); //余数标签 static Label Lb12=new Label(".0",Label.RIGHT); static TextArea TA=new TextArea("说明:由于软件不够完善,请规范运算的输入:1.可在里面按键输入",1000,TextArea.SCROLLBARS_VERTICAL_ONLY); static TextField TF=new TextField(); static GridLayout GL1=new GridLayout(5,4); //流动布局 static Panel Pl=new Panel(); //面板 static BorderLayout BL=new BorderLayout(); static shijian app1=new shijian(); //实现监听器的类对象 static char Data2[]=new char[5]; static Font fnt=new Font("Serief",Font.ITALIC+Font.BOLD,18); static Font fnt2=new Font("Serief",Font.BOLD,15); static String str22; static StringBuffer BS=new StringBuffer(""); //可创建空的字符串对象,这个很重要 static String str23=str22; public static void main(String args[]) throws IOException { frm1.setLayout(null); Pl.setLayout(GL1);//面板加入布局 frm1.setSize(253,450);//没有设置窗口大小 frm1.setLocation(250,450); Lb1.setBounds(0,55,250,25);//计算器数字输入显示框之一上边框 Pl.setBounds(0,80,250,290); Lb2.setBounds(370,60,50,25); Lb3.setBounds(370,90,50,25); Lb4.setBounds(370,120,50,25); Lb5.setBounds(300,150,320,25); Lb6.setBounds(250,60,120,25); Lb7.setBounds(250,90,120,25); Lb8.setBounds(250,120,120,25); Lb9.setBounds(250,150,30,25); Lb10.setBounds(0,365,250,30);//计算器数字输入显示框之一下边框 Lb11.setBounds(250,30,120,25); Lb12.setBounds(370,30,50,25); TF.setBounds(0,30,250,25); TA.setBounds(0,395,250,75); TA.setEditable(false); Pl.add(btn1);//面板 Pl.add(btn2); Pl.add(btn3); Pl.add(btn4); Pl.add(btn5); Pl.add(btn6); Pl.add(btn7); Pl.add(btn8); Pl.add(btn9);//加入按钮 Pl.add(btn14); Pl.add(btn16); Pl.add(btn17); Pl.add(btn10);//加 Pl.add(btn11);//减 Pl.add(btn12);//乘 Pl.add(btn13);//除 Pl.add(btn15);//这里是等号注意事件的监听器在不同的类上 Pl.add(btn17); Pl.add(btn18); Pl.add(btn19); Pl.add(btn20); frm1.add(Pl);//加入面板 frm1.addWindowListener(new shijian2()); frm1.add(Lb1); frm1.add(Lb2); frm1.add(Lb3); frm1.add(Lb4); frm1.add(Lb5); frm1.add(Lb6); frm1.add(Lb7); frm1.add(Lb8); frm1.add(Lb9); frm1.add(Lb10); frm1.add(Lb11); frm1.add(Lb12); frm1.add(TA); frm1.add(TF); //Lb2.setBackground(Color.pink); //Lb3.setBackground(Color.pink); //Lb4.setBackground(Color.pink); //Lb5.setBackground(Color.white); Lb6.setBackground(Color.white); Lb7.setBackground(Color.white); Lb8.setBackground(Color.white); Lb9.setBackground(Color.white); Lb10.setBackground(Color.gray); Lb11.setBackground(Color.white); TF.setBackground(Color.pink); //TA.setBackground(Color.pink); //Lb12.setBackground(Color.gray); Lb1.setFont(fnt); Lb2.setFont(fnt); Lb3.setFont(fnt); Lb4.setFont(fnt); Lb10.setFont(fnt); Lb11.setFont(fnt2); Lb12.setFont(fnt); Lb1.setBackground(Color.gray); btn1.addActionListener(app1); btn2.addActionListener(app1); btn3.addActionListener(app1); btn4.addActionListener(app1); btn5.addActionListener(app1); btn6.addActionListener(app1); btn7.addActionListener(app1); btn8.addActionListener(app1); btn9.addActionListener(app1); btn10.addActionListener(app1); btn11.addActionListener(app1); btn12.addActionListener(app1); //btn12.addActionListener(app1);//写两个这个则会被触发两次事件 btn13.addActionListener(app1); btn14.addActionListener(app1); btn15.addActionListener(app1); btn16.addActionListener(app1); btn17.addActionListener(app1); btn18.addActionListener(app1); btn19.addActionListener(app1); btn20.addActionListener(app1); TF.addTextListener(new shijian3()); frm1.setBackground(Color.white); frm1.setResizable(false); frm1.setVisible(true);//可见 } static class shijian implements ActionListener//接口的实现 { public void actionPerformed(ActionEvent e) { Button BT=(Button)e.getSource(); //取得事件的对象,用于判断事件所属 String str1=BT.getLabel(); //取得按钮的名字,也就是相应的数字 if(str1=="0"||str1=="1"||str1=="2"||str1=="3"||str1=="4"||str1=="5"||str1=="6"||str1=="7"||str1=="8"||str1=="9"||str1=="+"||str1=="-"||str1=="*"||str1=="/"||str1=="."||str1=="π") { if(str1=="π"){str1=Double.toString(Math.PI);} BS.append(str1);//将得到的字符串加入到原有字符串 String str22=BS.toString();//转换成字符串 String str56=Integer.toString(str22.length());//将整形转换成字符串 Lb10.setText(str22); Lb2.setText(str56); Lb3.setText(str56); Lb4.setText(str56); Lb5.setText("无"); Lb12.setText(".0"); Lb1.setText(str22); try{ FileWriter FQ=new FileWriter("D:\\java\\10.txt");FQ.write(str22);FQ.flush();} catch(Exception u) {System.out.println("出错了");}} if(str1=="=")//如果等于等号if里面包含多个if或者while { // System.out.println("str22="+str22); char Data[]=new char[BS.length()]; try{ FileReader FV=new FileReader("D:\\java\\10.txt");//写入所需数据 FV.read(Data);} //这是我们写入的数据, catch(Exception y){System.out.println("出错了");} while(k<Data.length) {k++; if(Data[k+1]=='/'||Data[k+1]=='*'||Data[k+1]=='+'||Data[k+1]=='-')//这个地方基本是整个程序的关键,包括识别使用者使用的计算符号, //还有就是为解决符号多个共存,又没有冲突,不能访问数组的第一位,如果第一位就有符号,那就会跳出,出现错误,只要不访问数组的第一位就好啦, //到了非一号的运算符时,会直接跳出,执行相应的动作 break;}; char ch2=Data[k+1]; if(ch2=='*') {Lb1.setText(""); //清空标签内的内容 String str90=BS.toString(); //转换并取得字符串的内容.字符串内容已经确定,只是调用 Lb10.setText(str90); // Lb10标签的显示 if(str90.indexOf(".")!=-1) //不等于1那么就是有点号,使用浮点数,利用的是系统抛出异常时赋的默认值 { int num1=str90.indexOf('*'); //取得*号的位置 String str2=str90.substring(0,num1); //取得数字字符窜 String str3=str90.substring(num1+1,BS.length()); //取得数字字符窜 // System.out.println("str2="+str2); // System.out.println("str3="+str3); float num2=Float.parseFloat(str2); //数据类型转换,使用长整形 float num3=Float.parseFloat(str3); //数据类型转换 float sum=(float)num2*num3; String str6=Float.toString(sum); //转换回字符串 Lb1.setText(str6); k=-1; BS=new StringBuffer(""); BS.append(str6);} if(str90.indexOf(".")==-1) //等于1那么就是没有有点号,使用非浮点数 { Lb1.setText(""); //清空标签内的内容 String str91=BS.toString(); //转换并取得字符串的内容.字符串内容已经确定,只是调用 Lb10.setText(str90); // Lb10标签的显示 int num1=str91.indexOf('*'); //取得*号的位置 String str2=str91.substring(0,num1); //取得数字字符窜 String str3=str91.substring(num1+1,BS.length()); //取得数字字符窜 // System.out.println("str2="+str2); //System.out.println("str3="+str3); long num2=Long.parseLong(str2); //数据类型转换,使用长整形 long num3=Long.parseLong(str3); //数据类型转换 long sum=num2*num3; String str6=Long.toString(sum); //转换回字符串 Lb1.setText(str6); k=-1; BS=new StringBuffer(""); BS.append(str6); } } if(ch2=='/') { Lb1.setText(""); //清空标签内的内容 String str91=BS.toString(); //转换并取得字符串的内容 Lb10.setText(str91); // Lb10标签的显示 //System.out.println("BS长度="+BS.length()); String str1000=BS.toString(); // System.out.println("str1000="+str1000); if(str91.indexOf(".")==-1){ int num1000=str1000.indexOf('/'); //取得*号的位置 // System.out.println("num1000="+num1000); String str2000=str1000.substring(0,num1000); String str3000=str1000.substring(num1000+1,BS.length()); int num2000=Integer.parseInt(str2000); int num3000=Integer.parseInt(str3000); int sum20=num2000/num3000; //整除数 int sum21=num2000%num3000; //余数 String str56=Integer.toString(sum20); String str57=Integer.toString(sum21); //System.out.println("sum="+sum20); Lb1.setText(str56); Lb12.setText(str57); BS=new StringBuffer("");k=-1; BS.append(Float.toString((float)num2000/(float)num3000));}//因为整形运算会有余数的求法,所以得转换成单精度型的数据类型进行计算,以免丢失数据 if(str91.indexOf(".")!=-1){ int num1000=str1000.indexOf('/'); //取得*号的位置 // System.out.println("num1000="+num1000); String str2000=str1000.substring(0,num1000); String str3000=str1000.substring(num1000+1,BS.length()); float num2000=Float.parseFloat(str2000); float num3000=Float.parseFloat(str3000); float sum20=(float)num2000/num3000; String str56=Float.toString(sum20); // System.out.println("sum="+sum20); Lb1.setText(str56); BS=new StringBuffer("");k=-1; BS.append(str56);} } if(ch2=='+'){ Lb1.setText(""); //清空标签内的内容 String str97=BS.toString(); //转换并取得字符串的内容 Lb10.setText(str97); // Lb10标签的显示 // System.out.println("BS长度="+BS.length()); String str1001=BS.toString(); // System.out.println("str1001="+str1001); if(str97.indexOf(".")==-1){ int num1001=str1001.indexOf('+');//取得*号的位置 // System.out.println("num1001="+num1001); if(num1001>0){ String str2001=str1001.substring(0,num1001); String str3002=str1001.substring(num1001+1,BS.length()); int num2001=Integer.parseInt(str2001); //如果是由小数点的结果则要将数据类型转换成float int num3001=Integer.parseInt(str3002); int sum21=num2001+num3001; String str51=Integer.toString(sum21); // System.out.println("sum="+sum21); Lb1.setText(str51); BS=new StringBuffer("");k=-1; BS.append(str51);} if(num1001==0) { BS.deleteCharAt(0);//删除第一个减号 (BS.toString()).indexOf("+");//取得第二个减号的位置 //StringBuffer str69=new StringBuffer(BS.toString()); //这里必须引入其他的字符串变量来储存,关键在于获得不是第一个减号的位置 //str69.insert(0,'+'); String str2001=(BS.toString()).substring(0,((BS.toString()).indexOf("+"))); String str3002=(BS.toString()).substring(((BS.toString()).indexOf("+")+1),(BS.length())); int num2001=Integer.parseInt(str2001); //如果是由小数点的结果则要将数据类型转换成float int num3001=Integer.parseInt(str3002); int sum21=num2001+num3001; String str51=Integer.toString(sum21); // System.out.println("sum="+sum21); Lb1.setText(str51); BS=new StringBuffer("");k=-1; BS.append(str51); } } if(str97.indexOf(".")!=-1) { //利用抛出异常的数字是-1的规律,设定if语句 int num1001=str1001.indexOf('+');//取得*号的位置 // System.out.println("num1001="+num1001); if(num1001>0){ String str2001=str1001.substring(0,num1001); String str3002=str1001.substring(num1001+1,BS.length()); float num2001=Float.parseFloat(str2001); //如果是由小数点的结果则要将数据类型转换成float float num3001=Float.parseFloat(str3002); float sum21=(float)num2001+num3001; String str51=Float.toString(sum21); //System.out.println("sum="+sum21); Lb1.setText(str51); BS=new StringBuffer("");k=-1; BS.append(str51);} if(num1001==0) { BS.deleteCharAt(0);//删除第一个减号 (BS.toString()).indexOf("+");//取得第二个减号的位置 String str2001=(BS.toString()).substring(0,((BS.toString()).indexOf("+"))); String str3002=(BS.toString()).substring(((BS.toString()).indexOf("+")+1),(BS.length())); float num2001=Float.parseFloat(str2001); //如果是由小数点的结果则要将数据类型转换成float float num3001=Float.parseFloat(str3002); float sum21=(float)num2001+num3001; String str51=Float.toString(sum21); //System.out.println("sum="+sum21); Lb1.setText(str51); BS=new StringBuffer("");k=-1; BS.append(str51); } } } //k值已经变化,为使上面的语句的循环有用,的赋回原值 if(ch2=='-') { Lb1.setText(""); //清空标签内的内容 String str102=BS.toString(); //转换并取得字符串的内容 Lb10.setText(str102); // Lb10标签的显示 // System.out.println("BS长度="+BS.length()); String str1002=BS.toString(); // System.out.println("str1002="+str1002); if(str1002.indexOf(".")==-1) //利用抛出异常的数字是-1的规律,设定if语句 {int num1002=str1002.indexOf('-');//取得*号的位置 // System.out.println("num1002="+num1002); if(num1002>0){ String str2002=str1002.substring(0,num1002); String str3003=str1002.substring(num1002+1,BS.length()); int num2002=Integer.parseInt(str2002); int num3002=Integer.parseInt(str3003); int sum22=num2002-num3002; String str53=Integer.toString(sum22); // System.out.println("sum="+sum22); Lb1.setText(str53); BS=new StringBuffer("");k=-1; BS.append(str53);} if(num1002==0){//由于会有两个减号存在的情况,应该要分情况,比如负数加负数的时候 BS.deleteCharAt(0);//删除第一个减号 (BS.toString()).indexOf("-");//取得第二个减号的位置 StringBuffer str67=new StringBuffer(BS.toString()); //这里必须引入其他的字符串变量来储存,关键在于获得不是第一个减号的位置 str67.insert(0,'-'); String str2002=(str67.toString()).substring(0,((BS.toString()).indexOf("-")+1)); String str3003=(str67.toString()).substring(((BS.toString()).indexOf("-")+2),(BS.length()+1)); int num2002=Integer.parseInt(str2002); int num3002=Integer.parseInt(str3003); int sum22=num2002-num3002; String str53=Integer.toString(sum22); // System.out.println("sum="+sum22); Lb1.setText(str53); BS=new StringBuffer("");k=-1; BS.append(str53); }} if(str1002.indexOf(".")!=-1) { int num1002=str1002.indexOf('-');//取得*号的位置 StringBuffer str66=new StringBuffer(str1002); // System.out.println("num1002="+num1002); if(num1002>0){ String str2002=str1002.substring(0,num1002); String str3003=str1002.substring(num1002+1,BS.length()); float num2002=Float.parseFloat(str2002); float num3002=Float.parseFloat(str3003); float sum22=(float)(num2002-num3002); String str53=Float.toString(sum22); // System.out.println("sum="+sum22); Lb1.setText(str53); BS=new StringBuffer("");k=-1; BS.append(str53);} if(num1002==0) { BS.deleteCharAt(0);//删除第一个减号 (BS.toString()).indexOf("-");//取得第二个减号的位置 StringBuffer str68=new StringBuffer(BS.toString()); //这里必须引入其他的字符串变量来储存,关键在于获得不是第一个减号的位置 str68.insert(0,'-'); String str2002=(str68.toString()).substring(0,((BS.toString()).indexOf("-")+1)); String str3003=(str68.toString()).substring(((BS.toString()).indexOf("-")+2),(BS.length()+1)); float num2002=Float.parseFloat(str2002); float num3002=Float.parseFloat(str3003); float sum22=(float)(num2002-num3002); String str53=Float.toString(sum22); // System.out.println("sum="+sum22); Lb1.setText(str53); BS=new StringBuffer("");k=-1; BS.append(str53); } } }} if(str1=="清零")//删除键 { TF.setText(""); Lb12.setText(".0"); Lb2.setText(".0"); Lb3.setText(".0"); Lb4.setText(".0"); Lb1.setText(".0"); Lb5.setText("无"); Lb10.setText(".0"); BS=new StringBuffer(""); //System.out.println("str22="+str22);//测试 //归无,即使是把对想的内容给删除了,也就是数组的大小事零,但是调用的那个文本并没有归零, //System.out.println("str22="+str22); Lb2.setText(".0"); Lb3.setText(".0");//在清除BS的同时Lb3也会跟着归零 try{FileWriter FP=new FileWriter("D:\\java\\10.txt"); FP.write(str9);//不能写整形数组,只能写字符类型的数组 FP.flush(); FP.close(); k=-1; } //在这里给k赋值,若果计算执行,那么k没有办法在=号哪里进行设置,这里可以设置一下原值的赋值,错误那么可以通过归原值进行调节} //所以每个语句执行完之后都得注意把值给赋回去 catch(Exception o) {Lb5.setText("已经没有数据可删除!");} } try{ if(str1=="后退") //在这里拦住的思路,没按一下“后退”按钮就删最后一个,从BS.length(); //得到的长度是不能直接用来做字符串索引值的,因为达到的长度是整数,要应用于删除字符上,应该减一,不然会出现超出异常 { i++; Lb12.setText(".0");//余数清零上面的标签 if(i<BS.length()+1) //注意这里的设值,应该是 { BS.deleteCharAt(BS.length()-1); //由于BS是static,哪里改变它它就按哪里的标准进行处理,像赋值 String str67=Integer.toString(BS.length());//剩余字符数 Lb2.setText(str67); //应该减一 // System.out.println("剩下字符串数目:"+BS.length()); Lb4.setText(str67); TF.setText(BS.toString()); Lb1.setText(BS.toString()); Lb10.setText(BS.toString());//显示剩下的字符串下方标签 Lb3.setText(str67); } if(BS.length()==0) { Lb1.setText(".0");} i=-1; //要加上这个,因为没按一次后退都会加上一,总有一次会超过字符长度,执行完相应的 语句之后将它赋回原值 }} catch(Exception p) { Lb5.setText("已经没有数据可删除!"); } if(str1=="颜色") { l++; if(l==0) {frm1.setBackground(Color.yellow); Lb2.setBackground(Color.yellow); Lb3.setBackground(Color.yellow); Lb4.setBackground(Color.yellow); Lb5.setBackground(Color.yellow); Lb6.setBackground(Color.yellow); Lb7.setBackground(Color.yellow); Lb8.setBackground(Color.yellow); Lb9.setBackground(Color.yellow); Lb11.setBackground(Color.yellow); Lb12.setBackground(Color.yellow); } if(l==1) {frm1.setBackground(Color.pink); Lb2.setBackground(Color.pink); Lb3.setBackground(Color.pink); Lb4.setBackground(Color.pink); Lb5.setBackground(Color.pink); Lb6.setBackground(Color.pink); Lb7.setBackground(Color.pink); Lb8.setBackground(Color.pink); Lb9.setBackground(Color.pink); Lb11.setBackground(Color.pink); Lb12.setBackground(Color.pink); } if(l==2) {frm1.setBackground(Color.red);Lb2.setBackground(Color.red); Lb3.setBackground(Color.red); Lb4.setBackground(Color.red); Lb5.setBackground(Color.red); Lb6.setBackground(Color.red); Lb7.setBackground(Color.red); Lb8.setBackground(Color.red); Lb9.setBackground(Color.red); Lb11.setBackground(Color.red); Lb12.setBackground(Color.red); } if(l==3) {frm1.setBackground(Color.gray);Lb2.setBackground(Color.gray); Lb3.setBackground(Color.gray); Lb4.setBackground(Color.gray); Lb5.setBackground(Color.gray); Lb6.setBackground(Color.gray); Lb7.setBackground(Color.gray); Lb8.setBackground(Color.gray); Lb9.setBackground(Color.gray); Lb11.setBackground(Color.gray); Lb12.setBackground(Color.gray); } if(l==4) {frm1.setBackground(Color.orange);Lb2.setBackground(Color.pink); Lb3.setBackground(Color.orange); Lb4.setBackground(Color.orange); Lb5.setBackground(Color.orange); Lb6.setBackground(Color.orange); Lb7.setBackground(Color.orange); Lb8.setBackground(Color.orange); Lb9.setBackground(Color.orange); Lb11.setBackground(Color.orange); Lb12.setBackground(Color.orange); } if(l==5) {frm1.setBackground(Color.white);Lb2.setBackground(Color.white); Lb3.setBackground(Color.white); Lb4.setBackground(Color.white); Lb5.setBackground(Color.white); Lb6.setBackground(Color.white); Lb7.setBackground(Color.white); Lb8.setBackground(Color.white); Lb9.setBackground(Color.white); Lb11.setBackground(Color.white); Lb12.setBackground(Color.white); } if(l==6) {frm1.setBackground(Color.blue);l=-1;Lb2.setBackground(Color.blue); Lb3.setBackground(Color.blue); Lb4.setBackground(Color.blue); Lb5.setBackground(Color.blue); Lb6.setBackground(Color.blue); Lb7.setBackground(Color.blue); Lb8.setBackground(Color.blue); Lb9.setBackground(Color.blue); Lb11.setBackground(Color.blue); Lb12.setBackground(Color.blue); } } }//内部类的函数 }//内部类 public static class shijian2 extends WindowAdapter { public void windowClosing(WindowEvent o) { System.exit(0); } } static class shijian3 implements TextListener { public void textValueChanged(TextEvent q) { Lb12.setText(".0"); try{BS=new StringBuffer(TF.getText());//写入BS,改变BS的值 FileWriter FY=new FileWriter("D:\\java\\10.txt");FY.write(TF.getText());FY.flush();}//同时写入同一个文本内相当于拥有两份运算的数据,当按面板是也会将文本覆盖,不清空 catch(Exception u) {System.out.println("出错了");} Lb2.setText(Integer.toString(BS.length())); Lb3.setText(Integer.toString(BS.length())); Lb4.setText(Integer.toString(BS.length())); Lb5.setText(Integer.toString(BS.length())); Lb1.setText(BS.toString()); //让数字输入的同时取得BS字符串BS也是整个程序的关键,整个程序围绕BS进行,包括加入修改,新添 Lb10.setText(BS.toString()); } } }//主类 Ps:QQ:550119320

2012-10-10

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除