* First we declare JTextField like this JTextField testField = new JTextField(10);* We can get textfield value in String like this on any button click event.button.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ae){ String getValue = testField.getText() }})