public class RichJLabel extends JLabel { /** * 字符间隙 */ private int tracking; /** * 构造函数 * * @param text 文本 * @param tracking 字符间隙 */ public RichJLabel(String text, int tracking) { super(text); this.tracking = tracking; }
// 文本的定位信息 private int left_x, left_y, right_x, right_y;
// 文本的颜色信息 private Color left_color, right_color;
/** * 设置左阴影 * * @param x 定位信息 * @param y 定位信息 * @param color 颜色 */ public void setLeftShadow(int x, int y, Color color) { left_x = x; left_y = y; left_color = color; }
/** * 设置右阴影 * * @param x 定位信息 * @param y 定位信息 * @param color 颜色 */ public void setRightShadow(int x, int y, Color color) { right_x = x; right_y = y; right_color = color; } } |