//定义变量
private String checkname = "";
private int checktype = 0;
bmiMin = new Text(composite_1, SWT.BORDER);
bmiMin.setBounds(604, 40, 33, 20);
bmiMin.setTextLimit(3);
bmiMin.addListener(SWT.FocusIn, new Listener() {
public void handleEvent(Event event) {
if (checktype == 0) {
checkname = "bmiMin";
checktype = 1;
}
}
});
bmiMin.addListener(SWT.FocusOut, new Listener() {
public void handleEvent(Event event) {
if(bmiMin.getText() == null || "".equals(bmiMin.getText().trim())){
checkname = "";
checktype = 0;
}else{
String value="";
if ("bmiMin".equals(checkname) && checktype == 1) {
value=CommonCheck.checkIntNum(CommonCheck.dele(bmiMin.getText().trim()));
if(!"".equals(value)){
loginPrompt=new Logi
SWT中当光标移开文本框时验证
最新推荐文章于 2021-08-07 19:28:10 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)