简易JAVA获取网页有效邮箱地址
// 简易JAVA获取网页有效邮箱地址 ---by 77
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class solo7 {
public static void main(String args[]){
new Win();
}
}
class Win extends Frame implements ActionListener,Runnable{
Button button;
URL url;
TextField text;
TextArea area;
byte b[]=new byte[118];
Thread thread;
Win(){
text=new TextField(20);
area=new TextArea(12,12);
button=new Button("确定");
button.addActionListener(this);
thread=new Thread(this);
Panel p=new Panel();
p.add(new Label("输入网址:"));
p.add(text);
p.add(button);
add(area,BorderLayout.CENTER);
add(p,BorderLayout.NORTH);
setBounds(60,60,360,300);
setVisible(true);
validate();
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
public void actionPerformed(ActionEvent e){
if(!(thread.isAlive()))
thread=new Thread(this);
try{
thread.start();
}
catch(Exception ee){
text.setText("正在读取"+url);
}
}
private boolean isNameAdressFormat(String email){
boolean isExist = false;
Pattern p = Pattern.compile("\\w{1,}@\\w{1,}
\56\\w{1,}");
Matcher m = p.matcher(email);
boolean b = m.matches();
if(b) {
isExist=true;
&nbs
相关文档:
从5月5号进入就业班到现在四天的时间了,上了这几天课发现就业班的强度真的很大,不像以前基础班的时候那么还比较轻松,已经渐渐感觉到了吃力,因为现在上课需要讲解的知识点太多,有时候下午老师讲到6点多钟才下课,课上的练习时间越来越少了,只能自己利用课后的时间多练习实践,许多东西还都是第一次 ......
1. 先写一个Singleton的class
package stone;
public class Singleton {
private static Singleton instance;
private Singleton() {}
public static Singleton getInstance(){
if(instance==null)
&n ......
移位运算符
包括:
“>> 右移”;“<< 左移”;“>>> 无符号右移”
例子:
-5>>3=-1
1111 1111 1111 1111 1111 1111 1111 1011
1111 1111 1111 1111 1111 1111 1111 1111
其结果与 Math.floor((double)- ......