Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

loading a file...  RSS feed

 
MJ Seah
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i load a text file that is saved previously in the program i done? is there a short and precise method to do it?? please enlighten me. Thank you! probably if you could attach a coding to it. Thanks!!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, no GUI stuff. Moving to IO and Streams.
 
MJ Seah
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm... i got the first one... printing the file into the command prompt. Because i am doing something like freehand drawing and this freehand drawing is saved with all the X and Y coordination that is drawn into a text file. Is there a way that i can use java programming to convert the coordination back to the picture that i drawn previously and display them in the Frame i created? Please kindly put in the codings if possible. Thank you!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guesswork, in the absence of the file format.

if the file format is
150,250
180,270
etc

you could do something like this (aircode - expect a typo or two)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!