here is how should my program be. In first frame, there is a textfield1 where a user input text and when he press a button, a new frame will be display with a textfield2 that displays the inputted text from the textfield1. please help me with the syntax. i'm still a beginner in java. much thanks guys.
First Frame:
textfield= new JTextField();
textfield.setPreferredSize( new Dimension(200,30) ) ;
textfield.setSize( textfield.getPreferredSize() ) ;
textfield.setLocation(95,198) ;
textfield.setSize(175,28);
cont.add(textfield);
public void actionPerformed(ActionEvent e) {
this.setVisible(false);
new Frame2().setVisible(true); //displays the 2nd frame right?
}
now i don't know what to do on my 2nd frame or where to start because i can't get the variable from the first frame