构造器

在一次重温了构造器的概念,感受到一些感悟,构造器的关键在于传入文本域。

Action ls = new Action(test, field);
bu.addActionListener(ls);


public Action(JTextField test, JTextField field) {
this.test=test;
this.field=field;
// TODO Auto-generated constructor stub
}

你可能感兴趣的:(构造器)