SendThread.java
资源名称:J2ME.rar [点击查看]
上传用户:sygbg6
上传日期:2020-12-29
资源大小:4884k
文件大小:1k
源码类别:
游戏
开发平台:
Java
- package cn.com.imageanalyze;
- import cn.com.imageanalyze.analyzer.SimpleAnalyzer;
- import cn.com.imageanalyze.customform.dialog.MessageDialog;
- public class SendThread extends Thread {
- MainForm m;
- byte[] buff;
- public SendThread(MainForm m ,byte[] buff){
- this.m = m;
- this.buff = buff;
- }
- public void run(){
- if (buff != null) {
- // buff = SimpleImageTrans.trans(buff, 320, 240);
- String text = null;
- MessageDialog md = new MessageDialog("正在分析....",m);
- md.confirm = false;
- md.setContent("正在分析....请稍后");
- md.show();
- try {
- text = SimpleAnalyzer.analyze(buff);
- // SucessDialog sd = new SucessDialog("分析结果");
- // sd.setDisplay(display);
- // sd.setParent(parent);
- // sd.setContent(text);
- // sd.show();
- MessageDialog mdd = new MessageDialog("分析结果",m);
- mdd.setContent(text);
- mdd.show();
- } catch (Exception e) {
- System.out.println("aaa" + e.toString());
- e.printStackTrace();
- MessageDialog md1 = new MessageDialog("失败",m);
- md1.setContent("网络异常,请稍候重试");
- md1.show();
- }
- } else {
- MessageDialog md = new MessageDialog("失败",m);
- md.setContent("此手机不支持320*240的分辨率!");
- md.show();
- }
- }
- }