![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java小功能
iteye_15714
这个作者很懒,什么都没留下…
展开
-
给图片添加文字水印、图片水印,图片缩放
import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.Image; import java.awt.geom.AffineTransform; import jav...原创 2009-03-24 11:15:14 · 198 阅读 · 0 评论 -
java中产生随机数
import java.util.Random; /** * Java实用工具类库中的类java.util.Random提供了产生各种类型随机数的方法。 * 它可以产生int、long、float、double以及Goussian等类型的随机数。 * java.lang.Math中的方法random()只产生double型的随机数。 */ public class Rand...2009-03-24 11:28:05 · 67 阅读 · 0 评论 -
文本框鼠标点击全部选中
有的时候需要在单击文本框时全选其中的内容,这时就可以用select()方法。如下2009-03-24 11:34:15 · 464 阅读 · 0 评论 -
添加文字水印:
import java.awt.*; import java.awt.image.*; import java.io.*; import javax.swing.*; import com.sun.image.codec.jpeg.*; public class WaterSet { /** *//** * 给图片添加水印 * * ...2009-03-24 14:04:40 · 70 阅读 · 0 评论 -
myeclipse6.0.1 注册码
[code="java"] import java.io.*; public class MyEclipseGen { private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreemen...原创 2009-04-01 14:31:26 · 100 阅读 · 0 评论 -
截取字符串
用数组: [code="java"]char[] c=a.toCharArray(); c[0]='b'; a=new String(c); 用StringBuffer(): StringBuffer b = new StringBuffer( a ); b.setCharAt( 0 , 'b' );//单引号 a=b.toString(); [/code]...2009-04-10 16:27:41 · 86 阅读 · 0 评论 -
获取当天时间的前一天和后一天
[code="java"]package com.htjy.jsuan;import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; /** * @author Administrator * * TODO To change the template ...原创 2010-01-12 18:02:40 · 699 阅读 · 0 评论 -
java中 String,Long,int类型转换
如何将字串 String 转换成整数 int? A. 有两个方法: 1). int i = Integer.parseInt([String]); 2). int i = Integer.valueOf(my_str).intValue(); Long转换成int类型 int uservalue = Integer.parseInt(String.valueOf...2010-02-25 16:54:33 · 500 阅读 · 0 评论