- 博客(16)
- 资源 (2)
- 收藏
- 关注
原创 2009
My advantage is that I am handsome, but my disadvantage is that handsomeness is not so obvious.
2009-09-05 16:44:14 79
原创 构建不规则窗体
public static void main(String[] args) { JFrame.setDefaultLookAndFeelDecorated(true); SwingUtilities.invokeLater(new Runnable() { public void run() { Window win = new CrasyDo...
2009-06-29 12:44:11 104
原创 Swing创建透明度窗口
public static void main(String[] args) {// JFrame.setDefaultLookAndFeelDecorated(true); SwingUtilities.invokeLater(new Runnable() { public void run() { Window win = new CrasyD...
2009-06-29 12:24:54 329
原创 下载远程文件
new Thread(new Runnable() { public void run() { String path = urlPath.getText(); try { URL url = new URL(path); URLConnection conn =...
2009-06-27 23:20:19 85
原创 自己绘制JPEG图片
String sFileName = "name.jpg"; try { FileOutputStream fos = new FileOutputStream(sFileName); BufferedImage myImage = new BufferedImage(225, 225, Buffere...
2009-06-27 16:58:10 196
原创 中文词组排序
String[] names = {"张山","李四","王五","爱情","幸福","郑森","郑"}; String c2 = "I"; Comparator cmp = Collator.getInstance(Locale.CHINA); Arrays.sort(names,cmp); for(int i =0;i<n
2009-06-27 15:57:25 232
原创 MD5加密
String content = "I love you "; try { byte []input = content.getBytes(); MessageDigest md = MessageDigest.getInstance("MD5"); // also "SHA" md.update(input); byte []output = md.digest(...
2009-06-27 15:46:54 62
原创 java正则表达式说明
Java正则表达式的解释说明 (作用:查询、提取、分割、删除或替换)表达式意义:1.字符x 字符 x。例如a表示字符a\\ 反斜线字符。在书写时要写为\\\\。(注意:因为java在第一次解析时,把\\\\解析成正则表达式\\,在第二次解析时再解析为\,所以凡是不是1.1列举到的转义字符,包括1.1的\\,而又带有\的都要写两次)\0n 带有八进制值 0的字符 n (0...
2009-06-27 15:27:09 73
原创 去掉HTML标记
Pattern pattern = Pattern.compile("<.+?>", Pattern.DOTALL); Matcher matcher = pattern.matcher("<a href=\"index.html\">主页</a>"); String string = matcher.replaceAll("");
2009-06-27 15:05:08 77
原创 电子邮件地址的正则匹配
String str = "9455046@qq.com";Pattern pattern = Pattern.compile("[\\w|\\d]+@(\\w+\\.)+[a-z]{2,3}"); Matcher matcher = pattern.matcher(str);System.out.println(matcher.find());
2009-06-27 15:00:40 203
原创 获得指定网面的IP地址
try { URL url = new URL(“urlAddress”); InetAddress address = InetAddress.getByName(url.getHost()); String ip = address.getHostAddress(); System.out.println(ip); System.o...
2009-06-27 12:31:35 107
原创 java创建多级文件目录
// File root= new File("root\\level1\\level2");if (!root.exists()) root.mkdirs();
2009-06-27 12:23:32 114
原创 java获取本机mac地址
try { Process process = Runtime.getRuntime().exec("ipconfig /all"); InputStreamReader ir = new InputStreamReader(process .getInputStream()); LineNumberReader input = new LineNumberReader(ir); ...
2009-06-27 12:12:13 88
Design and Implementation of a User-Level Thread Library for Testing and Reproducing Concurrency Scenarios
2009-03-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人