• Post Reply Bookmark Topic Watch Topic
  • New Topic

JList from StringTokenized array

 
Chip Frank
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok folks, this is my first post, be gentle.
I have one package / class that I've written a StringTokenizer for to import an external file's contents.
The class calling this is the GUI . . . the JList that I would like to populate with the contents of some of this array's elements.
My sticking point is this:
I can't quite figure out how to work around the IOException necessary with FileReader/Writer & having my main method in the GUI class call the array from the StringTokenizer file.
When it will compile, it terminates prematurely with thrown errors in regards to the line that imports the package (first instance of calling something from that package), and the lines thereafter referencing any classes in that package.
When it doesn't compile, it either wants an IOException called directly from my call for new GUI() in the main method, or one of the lines calling the contents of the StringTokenizer package.
If need be, I can post code fragments; though I'm looking for leads or direct references to material I can read (examples, not API's )
Thanks!
Chip.
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it would be helpful if you could post the exceptions including the lines of code (the specific methods) where the exception occurred (at the line number of your class that appears first in the stack trace).
if the exception concerns the import of a package (for example: NoClassDefFoundError) you should check your classpath settings.
chantal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!