ใครพอเขียน captcha in java แบบ GUI ได้มั้งครับ

กระทู้คำถาม
พอดีใส่รูปแล้วไม่ขึ้นอะ จะกรอกตัวอักษรตามภาพด้วยครับ ใครพอช่วยได้มั้ง
แล้วนี้ โค้ดครับ
package pkg4109_4547;
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import java.awt.FlowLayout;
import javax.swing.JTextField;
import javax.swing.JLabel;
import java.awt.Container;
import javax.swing.JTextArea;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
import javax.swing.ImageIcon;
import javax.swing.Icon;

public class Main implements ActionListener{
    Container contentPane;
    Container con;
    JFrame f1;
    JButton b1,b2;
    JPanel p1,p2,p3;
    JLabel l1,l2;
    JTextField t1,t2;
    JTextArea ta1;
    int row;
    private final String[] images;
   
    public static void main(String[] args) {
       Main sc = new Main();
           sc.SHOW();
                   }

    public Main() {
        this.images = new String[]{};
    }
void SHOW (){
        f1 = new JFrame("Security");
        b1 = new JButton("Refresh");
        b2 = new JButton("Submit");
        
        contentPane = f1.getContentPane();
        contentPane.setLayout(new BorderLayout( ));
        
        l1 = new JLabel ("Security Check");
        l2 = new JLabel ("Text in the box");
        
        ta1 = new JTextArea(4,15);
        t1 = new JTextField(7);
        
        f1.setSize(300,150);
        f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        p1 = new JPanel();
        p1.setLayout(new BorderLayout());
        p1.add(l1,BorderLayout.WEST);
        p2 = new JPanel();
        p2.setLayout(new FlowLayout());
        p2.add(ta1,BorderLayout.WEST);
        p2.add(b1,BorderLayout.EAST);
        
        p3 = new JPanel();
        p3.setLayout(new FlowLayout());
        p3.add(l2,BorderLayout.WEST);
        p3.add(t1,BorderLayout.CENTER);
        p3.add(b2,BorderLayout.EAST);
        
        contentPane.add(p1,BorderLayout.NORTH);
        contentPane.add(p2,BorderLayout.CENTER);
        contentPane.add(p3,BorderLayout.SOUTH);
        
        b1.addActionListener(this);
        b2.addActionListener(this);
                            
        f1.setVisible(true);
        
       }   
   
    @Override
    public void actionPerformed(ActionEvent e) {
        String buttonString = e.getActionCommand();
        String text;
        
        if(buttonString.equals("Refresh")){
            int n = (int) Math.floor(Math.random());
            String image = images[n];
            ta1.setIcon(new ImageIcon("/image/" + image +".jpg"));
        }
        else if (buttonString.equals("Submit")){
            text = t1.getText();
            text = text.toUpperCase();
            
            if(text.equals(code[n])){
                System.out.println("PASS");
            }else{
                System.out.println("NOT PASS");
                row++;
                if (row==3){
                    System.out.println("Stop Security");
                }
            }
        }
    }    
}
แสดงความคิดเห็น
โปรดศึกษาและยอมรับนโยบายข้อมูลส่วนบุคคลก่อนเริ่มใช้งาน อ่านเพิ่มเติมได้ที่นี่