- 浏览: 13419 次
- 性别:
- 来自: 广州
最新评论
文章列表
My advantage is that I am handsome, but my disadvantage is that handsomeness is not so obvious.
- 2009-09-05 16:44
- 浏览 339
- 评论(0)
public static void main(String[] args)
{
JFrame.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
Window win = new CrasyDownload();
AWTUtilities.setWindowShape(win, new Ellipse2D.Double(0, 0, win
.getWidth(), ...
- 2009-06-29 12:44
- 浏览 808
- 评论(0)
public static void main(String[] args)
{
// JFrame.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
Window win = new CrasyDownload();
AWTUtilities.setWindowOpacity(win, 0.6f);
}
});
}
其中CrasyDownload是自己定义的 ...
- 2009-06-29 12:24
- 浏览 1154
- 评论(0)
new Thread(new Runnable()
{
public void run()
{
String path = urlPath.getText();
try
{
URL url = new URL(path);
URLConnection conn = url.openConnection();
InputStream in = conn.getInputStream();
String saveName = ...
- 2009-06-27 23:20
- 浏览 794
- 评论(0)
String sFileName = "name.jpg"; try { FileOutputStream fos = new FileOutputStream(sFileName); BufferedImage myImage = new BufferedImage(225, 225, BufferedImage.TYPE_INT_RGB);
Graphics g = myImage.getGraphics(); g.setColor(Color.white);
...
- 2009-06-27 16:58
- 浏览 704
- 评论(0)
JFileChooser
- 博客分类:
- java点滴
fc.showOpenDialog(null);
fc.showSaveDialog(null);
- 2009-06-27 16:42
- 浏览 754
- 评论(0)
String name = new String(yourName.getBytes("ISO-8859-1"),"GBK");
- 2009-06-27 16:12
- 浏览 554
- 评论(0)
String[] names = {"张山","李四","王五","爱情","幸福","郑森","郑"}; String c2 = "I"; Comparator cmp = Collator.getInstance(Locale.CHINA); Arrays.sort(names,cmp); for(int i =0;i<names.length;i++) System.out.println(names[i]); ...
- 2009-06-27 15:57
- 浏览 865
- 评论(0)
String content = "I love you "; try { byte []input = content.getBytes(); MessageDigest md = MessageDigest.getInstance("MD5"); // also "SHA" md.update(input); byte []output = md.digest(); System.out.println(md.digest()); } catch (NoSuchAlgorithmE ...
- 2009-06-27 15:46
- 浏览 690
- 评论(0)
Java正则表达式的解释说明 (作用:查询、提取、分割、删除或替换)
表达式意义:
1.字符x 字符 x。例如a表示字符a\\ 反斜线字符。在书写时要写为\\\\。(注意:因为java在第一次解析时,把\\\\解析成正则表达式\\,在第二次解析时再解析为\,所以凡是不是1.1列举到的转义字符,包括1.1的\\,而又带有\的都要写两次)\0n 带有八进制值 0的字符 n (0 <= n <= 7)\0nn 带有八进制值 0的字符 nn (0 <= n <= 7)\0mnn 带有八进制值 0的字符 mnn(0 <= m <= 3 ...
- 2009-06-27 15:27
- 浏览 690
- 评论(0)
Pattern pattern = Pattern.compile("<.+?>", Pattern.DOTALL);
Matcher matcher = pattern.matcher("<a href=\"index.html\">主页</a>"); String string = matcher.replaceAll("");
System.out.println(string);
Pattern pattern = Pattern.co ...
- 2009-06-27 15:05
- 浏览 826
- 评论(0)
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
- 浏览 1330
- 评论(0)
try { URL url = new URL(“urlAddress”); InetAddress address = InetAddress.getByName(url.getHost()); String ip = address.getHostAddress(); System.out.println(ip); System.out.println(url.getHost()); } catch (MalformedURLException e) { // e.printStackTrace(); } cat ...
- 2009-06-27 12:31
- 浏览 773
- 评论(0)
//
File root= new File("root\\level1\\level2");
if (!root.exists()) root.mkdirs();
- 2009-06-27 12:23
- 浏览 1748
- 评论(0)