I am not a java programmer. But i have to solve this problem in java. I have a textbox and a button. after entering some text in the text box , by clicking the button i have to generate a new button whose text is same as that in the textbox. I have to create the buttons and add then to a Jpanel. Can anyone help me with this. This is the actionPerformed() i wrote, which was not working
public void actionPerformed(ActionEvent e) {
String str=textFeild1.getText();
panel1.add(new JButton(str));
}