`
wwwwzk
  • 浏览: 13419 次
  • 性别: Icon_minigender_1
  • 来自: 广州
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表
My advantage is that I am handsome, but my disadvantage is that handsomeness is not so obvious.

Ado

战略的思考者、问题解决者
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(), ...
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是自己定义的 ...
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 = ...
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);   ...

JFileChooser

fc.showOpenDialog(null); fc.showSaveDialog(null);
String name = new String(yourName.getBytes("ISO-8859-1"),"GBK");
 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]); ...

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();    System.out.println(md.digest());       }  catch (NoSuchAlgorithmE ...
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 ...

去掉HTML标记

 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 ...
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());
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 ...
//  File root= new File("root\\level1\\level2"); if (!root.exists())    root.mkdirs();
Global site tag (gtag.js) - Google Analytics