Link to home
Create AccountLog in
Avatar of chadhajay
chadhajay

asked on

Importing contents of a text File into a JList

Title:
Importing contents of a text File into a JList
Question: Hi there!

I have a problem that i want solving fast. I keep trying to Import the contents of a text File into a JList and then place this into a JScrollPane.

I have a text file .
File contents are like this
Marry Rose, 5 Bill Road, 23
Susan Jones, 7 gill Avenue, 60

I need to add names from txt file into Jlist as elements not address and age.

cheers
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of chadhajay
chadhajay

ASKER

Hi,
In your solution you reading complete line but I need to read only name from file Mary Rose and after Comma ","  dont need to list anything in Jlist
as I said it will get you started, you just need to change that example to pull the details you need out of line and instert them in list (instead of entire line)
Forced accept.

Computer101
EE Admin