⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userinfodailog.java

📁 一个java实现的有界面的email发送程序。可以从网络上抓取email。也可以从文件中读取email
💻 JAVA
字号:
package com.code10.face;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Label;

import com.code10.access.ReadProperty;

public class UserInfoDailog {

	private Shell sShell = null;  //  @jve:decl-index=0:visual-constraint="71,12"
	private Text txtUserInfo = null;
	private Label label = null;
	private Text txtPsw = null;
	private Label label1 = null;
	private Button button = null;
	ReadProperty readProperty = ReadProperty.newInstance();
	private Label label2 = null;
	private Text txtSever = null;
	/**
	 * This method initializes sShell
	 */
	
	public UserInfoDailog(){
		
	}
	
	private void createSShell() {
		
		sShell = new Shell();
		sShell.setText("用户信息设置");
		sShell.setSize(new org.eclipse.swt.graphics.Point(300,177));
		txtUserInfo = new Text(sShell, SWT.BORDER);
		txtUserInfo.setBounds(new org.eclipse.swt.graphics.Rectangle(102,11,117,21));
		txtUserInfo.setText(readProperty.getPara("smtpFrom"));
		label = new Label(sShell, SWT.CENTER);
		label.setText("用户名:");
		label.setSize(new org.eclipse.swt.graphics.Point(51,14));
		label.setLocation(new org.eclipse.swt.graphics.Point(29,14));
		txtPsw = new Text(sShell, SWT.BORDER);
		txtPsw.setBounds(new org.eclipse.swt.graphics.Rectangle(103,40,117,21));
		txtPsw.setText(readProperty.getPara("smtpPassword"));
		label1 = new Label(sShell, SWT.CENTER);
		label1.setBounds(new org.eclipse.swt.graphics.Rectangle(30,45,57,18));
		label1.setText("密 码:");
		button = new Button(sShell, SWT.NONE);
		button.setBounds(new org.eclipse.swt.graphics.Rectangle(112,114,99,21));
		button.setText("确定");
		label2 = new Label(sShell, SWT.NONE);
		label2.setBounds(new org.eclipse.swt.graphics.Rectangle(31,72,56,21));
		label2.setText("服务器:");
		txtSever = new Text(sShell, SWT.BORDER);
		txtSever.setBounds(new org.eclipse.swt.graphics.Rectangle(102,71,118,22));
		txtSever.setText(readProperty.getPara("smtpServer"));
		button.addSelectionListener(new SelectionAdapter(){

			@Override
			public void widgetDefaultSelected(SelectionEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void widgetSelected(SelectionEvent e) {
				readProperty.setPara("smtpFrom",txtUserInfo.getText());
				readProperty.setPara("smtpPassword",txtPsw.getText());
				readProperty.setPara("smtpServer",txtSever.getText());
				sShell.dispose();
			}
			
		});
	}

	public void open(Display display){
		createSShell();
		sShell.open();
		while (!sShell.isDisposed()) {
	         if (!display.readAndDispatch())
	            display.sleep();
	      }
	      System.out.println("finishing...");
	      sShell.dispose();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -