Hi !
I have a JFrame which contains some textfields and buttons. imagine a situation that a user wants to fill sth in textfield, then she/he needs more textfields to be shown ! I want when the user clicks a button, more textfields will appear !
its like cc/bcc in some Email services. you enter an address in "TO" and if you need to add BCC, just click on "add bcc" and a new textfield for entering address as BCC, will appear.
Can anyone help me to write it in Java?
I have tried this but no result :
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
jButton4.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
jButton4.add(new JTextField("j"));
NewJFrame a = new NewJFrame();
a.add( new JTextField("j"));
a.validate();
a.repaint();
a.setVisible(true);
Can anyone help me or write for me a whole new code ? Thanks a lot :)