package com.yw.test01;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Line2D;
import java.awt.image.BufferedImage;
import java.util.Random;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class PictureCheckCode {
public PictureCheckCode() {
super();
}
public static void main(String[] args) {
JFrame jf = new JFrame();
jf.setLayout(new FlowLayout());
PictureCheckCode pcc = new PictureCheckCode();
ImageIcon image=new ImageIcon(pcc.service());
JLabel label1 = new JLabel("<html><u>Label下划线</u><html>");
jf.add(label1);
JLabel label2 = new JLabel(image);
jf.add(label2);
jf.setVisible(true);
jf.setSize(300, 300);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
/* 该方法主要作用是获得随机生成的颜色 */
public Color getRandColor(int s, int e) {
Random random = new Ra
使用Swing制作java验证码
最新推荐文章于 2023-08-07 18:06:53 发布