|
In java swing or GUI, commonly when we want to read some text or string form textfield we have use to use button..example:
String Text;
JTextField Field;
//when button clicked
if(e.getSource==Button)
{
Text = Field.getText();
}
Instead of using this method, how to read the string from textfield when users press enter?
|