0
我使用的是斑馬線的核心1.7,斑馬線J2SE 1.7和攝像頭捕捉0.3.11庫QR掃描時間
可能是IDE的NetBeans 7.2和myqsl數據庫
問題是線程。 ...我似乎無法做出一個標識符打破並跳轉到另一種方法...我認爲即時通訊做得很錯... 任何想法? T_T
public void run() {
do {
try {
Thread.sleep(300);
} catch (InterruptedException e) {}
Result result = null;
BufferedImage image = null;
if (webcam.isOpen()) {
if ((image = webcam.getImage()) == null) {
continue;
}
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
try {
result = new MultiFormatReader().decode(bitmap);
} catch (NotFoundException e) {
}
}
int a;
a = (result.getText().length()); //thread error
if (result != null) {
txtID.setText(result.getText());
try {
QRLOAD();
} catch (Exception e) {} //method to load jtable
try {
Update_PIC();
} catch (Exception e) {} //method to load picture jlabel
try {
Time_inUP();
} //method to to update the time
catch (Exception e) {}
if (a > 1) {
OperatorQR(); //method to close the thread and call the main panel
} else {
}
}
} while (true);
}
請解釋你的意思是'做一個標識符來打破和跳躍它.. .. –
@ redflar3 確定即時通訊不好,無論從條款....我生成一個QR碼..值是1位數。 ...所以它很容易掃描...掃描它會產生一個jtextfield鍵的值釋放..生成jtable視圖,然後是圖片方法... 我似乎不能阻止它或停止它來驗證它......它直接去操作符方法殺死窗口......我想我需要一個標識符或說明符,使第一次嘗試趕上返回其結果和只能由操作符的方法結束... – Javamanadiktus
我嘗試將結果轉換爲int給出線程錯誤「CaptureCode.run(CaptureCode.java:817)」 – Javamanadiktus