📜  如何在动作侦听器中使用 java 中的另一个类 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:06.265000             🧑  作者: Mango

代码示例1
public class SomeActionListener implements ActionListener{

    private JTextField textField1;
    private JComboBox combo1;
    private JTextField textField2;
    //...

    public SomeActionListener(JTextField textField1, JComboBox combo1, 
                                          JTextField textField2){
        this.textField1=textField1;
        this.combo1=combo1;
        this.textField2=textField2;
        //...
    }

    public void actionPerformed(ActionEvent e) {
        //cmd
    }

}