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....
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
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)