Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Importing contents of a text File into a JList

Posted on 2007-10-03
5
Medium Priority
?
730 Views
Last Modified: 2013-11-23
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
0
Comment
Question by:chadhajay
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 20011585
0
 

Author Comment

by:chadhajay
ID: 20011659
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
0
 
LVL 92

Expert Comment

by:objects
ID: 20011685
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)
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20439038
Forced accept.

Computer101
EE Admin
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question