Q:

How can i convert strings placed in JtextField component into an integer

I'm new to java and I have tried a lot in converting strings placed in a JTextField Component into an integer type, but I couldn't. So kindly help me with this problem. 

A:

I guess you're trying to parse the String got from the user input on JTextField and not the JTextField at all, so it should be something like this. 
JTextField myTextField = new JTextField();

String textFromTextField = myTextField.getText();

int number = Integer.parseInt(textFromTextField);

System.out.println(number);

