aspose file tools*
The moose likes Beginning Java and the fly likes Problem with JList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Problem with JList

axel axek
Greenhorn

Joined: May 28, 2009
Posts: 20
I am having problems reading from a JList, my application consists in adding text line by line from a text file to a JList, ..and the problem that i am facing is...how can i read elements from Jlist, character by character .... help please....
axel axek
Greenhorn

Joined: May 28, 2009
Posts: 20
this is the code that reads form txt:
where "model" is Jlist model


and i have tried to read from list:
the line i'm tryng to read is something like: "S LLLL 0.2"

does anybody know any alternatives to read from a JList.....or a solution here....please help
and oh yes ..i've forgot to mention that this works just fine when using java.awt.List, but when i use JList...."bang" errors
axel axek
Greenhorn

Joined: May 28, 2009
Posts: 20
the complete error is this
Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: 4
at java.lang.String.charAt(String.java:687)
at Sesiune.init(Sesiune.java:595)
at Sesiune.itemStateChanged(Sesiune.java:294)
at java.awt.Choice.processItemEvent(Choice.java:604)
at java.awt.Choice.processEvent(Choice.java:571)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19790
    
  20

Please Use One Thread Per Question. Let's continue here.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with JList