java从网页中提取图片地址
import java.util.regex.Matcher;
import java.util.regex.Pattern;
1:这个是拿到一个字符取得里面的图像地址返回一个List
public static List<String> getImgStr(String htmlStr){
String img="";
Pattern p_image;
Matcher m_image;
List<String> pics = new ArrayList<String>();
String regEx_img = "<img.*src=(.*?)[^>]*?>"; //图片链接地址
p_image = Pattern.compile
(regEx_img,Pattern.CASE_INSENSITIVE);
m_image = p_image.matcher(htmlStr);
while(m_image.find()){
img = img + "," + m_image.group();
Matcher m = Pattern.compile("src=\"?(.*?)(\"|>|\\s+)").matcher(img); //匹配src
while(m.find()){
pics.add(m.group(1));
}
}
 
相关文档:
多继承:
C++中的类可以直接实现多继承 如:class D:public A,public B,public C{……};
Java中不能直接实现这样的多继承,但是可以用接口(interface)来间接实现 如:
public class A{ ……}
public interface C{
public void c1();
public void c2();
}
public class C exten ......
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......
class Global {
public static final String APPNAME= "xyz"; //全局常量
public static String currentUser = "abc"; // 全 ......
在所有组件都放到JFrame之后,先setSize(),然后再setVisible() 。
设置了窗口的Size,布局管理器才能为各个组件安排合适的位置,之后再把窗体显示出来setVisible(),比如你还不知道厂房的大小,这时就无法决定设备安放的位置。 ......