Hi, I'm using int TxtAge = Integer.parseInt(tfAge.getText().trim());to get value from my textfield and search it in database.

Then, I'm using Integer age = Integer.parseInt(stringTokenizer.nextElement().toString()); to go to next attributes in my database.

I have no problem using those codes for textfield but when I'm using the JComboBox the result won't display. How to use the StringTokenizer.nextElement for JComboBox? Is is the same with TextField?

String sex=(String) stringTokenizer.nextElement(); ---> I tried this code but still failed :(

Recommended Answers

What code are you using/trying to put those values into your text fields and combo box?

Jump to Post

All 2 Replies

What code are you using/trying to put those values into your text fields and combo box?

I'm trying to put integer values.All my attributes are integer

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.