import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.Rectangle;
public class JComboBox_test extends JFrame implements ItemListener {
    JComboBox jComboBox1 = new JComboBox();
    JTextField jTextField1 = new JTextField();
    JLabel jLabel1 = new JLabel("ѡ");
    public JComboBox_test() { 
        setLayout(null);
        jComboBox1.setBounds(25, 21, 114, 29);
        jComboBox1.addItemListener(this);
        jComboBox1.addItem("");
        jComboBox1.addItem("");
        jComboBox1.addItem("Ϻ");
        jLabel1.setBounds(12, 80, 74, 29);
        add(jComboBox1);
        add(jLabel1);
        add(jTextField1);
        jTextField1.setBounds(79, 80, 63, 27);
    } 
    public static void main(String args[]) {
        JComboBox_test ta = new JComboBox_test();
        ta.setBounds(200, 300, 250, 200);
        ta.validate();
        ta.setVisible(true);
    }
    public void itemStateChanged(ItemEvent e) {
        jTextField1.setText(jComboBox1.getSelectedItem().toString());
    }
}
