public class buttonInitialization extends JFrame {
public JButton[] button;
public buttonInitialization() {
setLayout(new FlowLayout());
JButton[] button = new JButton[2];
button[0] = new JButton("");
button[0].setText("dsadsa");
button[0].addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
button[0].setText("dsaadsdsa");
}
我无法button[0]
在动作监听器中访问它。我怎样才能做到这一点???