• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

get ID and show details

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to get ID number and display details.
my "SearchFile.txt" file is here:



when i use scanner class for get id number,and console window for display details , all things is good and perfect. but when i use a jtextfield for get id and a jlable for display detail information, program find just last record in file and not find other records.

my code is here:



I an new in java and coderanch,
please help!
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

When using code tags remember to highlight the code before clicking the 'Code' button. I've adjusted the tags for you this time.
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the code you are running - this code contains typos so can't be your actual code.

I'm not 100% sure what your problem is as your code doesn't show any values from a JTable and what is the display detail information?
Can you give more details please.

BTW why are you converting the value returned from the text field to an int and then converting it back to a String later on?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!