Skip to main content

JTextField into int

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
Yaaz
Offline
Joined: 2014-05-17

Hi
I'm a beginner. Was wondering if anyone perhaps know how to convert this into an int?

num1 = new JTextField("Enter your first number here");
add(num1);
num2 = new JTextField("Enter your second number here");
add(num2);

I want to add num1 and num2 and put in a 3rd textField?