package test; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Text; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.widgets.Display; import com.googlecode.javacv.FrameGrabber.Exception; public class RegisterShell { public static Shell sShell = null; // @jve:decl-index=0:visual-constraint="10,10" private Label label_User = null; private Button button_Next = null; public static Text text_User = null; private Label label = null; private Label labelTip = null; public RegisterShell(){ createSShell(); } public Shell getShell() { return sShell; } /** * This method initializes sShell */ private void createSShell() { sShell = new Shell(); sShell.setText("BP_FaceRecognizer_Register"); sShell.setSize(new Point(533, 317)); sShell.setLayout(null); label_User = new Label(sShell, SWT.NONE); label_User.setText("输入用户名:"); label_User.setFont(new Font(Display.getDefault(), "宋体", 10, SWT.NORMAL)); label_User.setBounds(new Rectangle(122, 67, 85, 25)); button_Next = new Button(sShell, SWT.NONE); button_Next.setBounds(new Rectangle(114, 140, 297, 42)); button_Next.setText("下一步"); labelTip = new Label(getShell(), SWT.NONE); labelTip.setBounds(new Rectangle(111, 210, 380, 80)); labelTip.setFont(new Font(Display.getDefault(), "宋体", 10, SWT.NORMAL)); labelTip.setText("如果想删除已注册的用户:1.将data中的Fortraining.txt打开,\n清空并保存" + "\n2.将data中的facedata.xml用记事本打开,\n清空,留下第一行<?xml version=?>并保存"); text_User = new Text(sShell, SWT.BORDER); text_User.setBounds(new Rectangle(239, 67, 168, 30)); label = new Label(getShell(), SWT.NONE); label.setBounds(new Rectangle(111, 118, 350, 80)); label.setFont(new Font(Display.getDefault(), "宋体", 12, SWT.NORMAL)); label.setText("请不要输入已存在的用户名且用户名不要带空格"); button_Next.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() { public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { String userName=RegisterShell.text_User.getText(); if(userName.isEmpty()==false) { FaceRecognizer fr=new FaceRecognizer(); try { fr.register(userName); LoginShell displayshell=new LoginShell(); Shell newShell= displayshell.getShell(); Shell oldShell=RegisterShell.sShell; RegisterShell.sShell=newShell; RegisterShell.sShell.open(); oldShell.dispose(); } catch (Exception e1) { e1.printStackTrace(); } } } }); } }
最近下载更多
tdcq123 LV14
3月22日
c15042361021 LV4
2022年11月8日
陆羽 LV5
2022年9月27日
yanxiaojie LV3
2021年9月29日
whfuai LV14
2021年8月19日
rruizy LV3
2021年6月30日
你是傻子 LV9
2021年5月24日
iRichard1314 LV6
2021年5月16日
liu3987741 LV8
2021年4月6日
秦峯123456 LV4
2021年3月24日
最近浏览更多
tdcq123 LV14
3月22日
鸦葱 LV4
1月6日
sky丶小十 LV7
2023年12月18日
WanLiuYun LV12
2023年11月8日
2652378774 LV7
2023年11月6日
1790759671
2023年11月1日
暂无贡献等级
xiaochoushishei
2023年8月22日
暂无贡献等级
微信网友_6557017070751744 LV1
2023年7月11日
2017143155 LV12
2023年6月28日
2517786374 LV4
2023年6月12日