[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

Converting data inside JTextField to interger

hi all

I want to convert what is inside a JTextField to integer. I use the following way :

int blck = Integer.parseInt(readTextField.toString());

but it does not work and it fies the exception handling when use it.

can some one tell me how can I do it and what classes I need to import ??
0
ehmf
Asked:
ehmf
  • 2
1 Solution
 
CEHJCommented:
Should be

nt blck = Integer.parseInt(readTextField.getText());
0
 
CEHJCommented:
:-)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now