에 나는JButtons 이름을 변경하고 새 이름을 사용하십시오. 방법
Container pane = getContentPane();
JPanel panel = new JPanel();
JButton b;
for(int i=1;i<115;i++)
{
b = new JButton(""+i);
panel.add(b);
}
그래서 모든 버튼은 이름 B를 취할 것입니다 루프에 의해
내가 버튼을 생성 한 114 버튼이있는 스윙 자바 응용 프로그램이 있습니다!
여기에 문제가 있습니다 각 단추마다 다른 단추를 사용하여 각 단추마다 다른 작업을 실행하고 싶습니다. 의 ActionListener 클래스
JButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
}
});