|
|
@@ -25,11 +25,9 @@ public class CaptchaUtil {
|
|
|
g.drawRect(0, 0, WIDTH - 1, HEIGHT - 1);
|
|
|
|
|
|
String captcha = generateRandomString();
|
|
|
- g.setFont(new Font("Arial", Font.PLAIN, 20));
|
|
|
+ g.setFont(new Font("DejaVu Sans", Font.PLAIN, 20));
|
|
|
for (int i = 0; i < LENGTH; i++) {
|
|
|
g.setColor(new Color(new Random().nextInt(255), new Random().nextInt(255), new Random().nextInt(255)));
|
|
|
- System.out.println(captcha);
|
|
|
- System.out.println(captcha.charAt(i));
|
|
|
g.drawString(String.valueOf(captcha.charAt(i)), 20 * i + 10, 30);
|
|
|
}
|
|
|
|