button.submit label 的位置问题

<label><input name=“name” type=”text”> <button>Submit</button></label>

 

这种情况下,在移动端,点击submit 时,键盘会一直保持存在而不会消失直到focus到其他元素上,

此时需要将button.submit 放到label 外面

转载于:https://www.cnblogs.com/lihuazhidao/p/5442590.html

import java.awt.Button; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Dialog { private String icon; private String title; private String message; private Button submit; private Button cancel; private Button close; private Dialog(){ } private Dialog(String icon, String title, String message, Button submit, Button cancel, Button close) { this.icon = icon; this.title = title; this.message = message; this.submit = submit; this.cancel = cancel; this.close = close; this.submit = new Button(); // 初始化submit按钮 this.cancel = new Button(); // 初始化cancel按钮 this.close = new Button(); // 初始化close按钮 } public void show(){ //弹出 } public void dismiss(){ //关闭 } static class Builder{ private Dialog dialog = new Dialog(); public Builder title(String title){ dialog.setTitle(title); return this; } public Builder icon(String icon){ dialog.setIcon(icon); return this; } public Builder message(String message){ dialog.setMessage(message); return this; } public Dialog build(){ return dialog; } } public void setSubmitText(String text){ submit.setLabel(text); } public void setCancelText(String text){ cancel.setLabel(text); } public void setCloseText(String text){ close.setLabel(text); } /** * 回调函数 * @param callback */ public void addListenerOnSubmit(SubmitCallBackListener callback){ submit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //当用户对按钮执行了动作操作以后, //程序会到此处执行 callback.submitCallback(e); } }); } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }这段代码怎么在myeclipse中运行出对话框
05-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值