File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Lines lost during reading of a file in JTextPane Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Lines lost during reading of a file in JTextPane" Watch "Lines lost during reading of a file in JTextPane" New topic
Author

Lines lost during reading of a file in JTextPane

Hunter McMillen
Ranch Hand

Joined: Mar 13, 2009
Posts: 490

Hey everyone,

I am reading java file into a JTextPane and some of the lines are getting skipped over, and I cant seem to find where, I think I just need another set of eyes to look at my read method.



any help would be great

Thanks,
Hunter

also posted at SO: http://stackoverflow.com/questions/6283467/lines-lost-during-reading-of-a-file-in-jtextpane


"If the facts don't fit the theory, get new facts" --Albert Einstein
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1788
    
    2
You have received an answer at the other forum, so why haven't you updated your posting here with the answer?

ignoreList++
Hunter McMillen
Ranch Hand

Joined: Mar 13, 2009
Posts: 490

I was planning on coming back to it later on, since I am at work and have other things to be doing. I marked the topic as resolved to indicate I had found an answer, so no one would waste their time looking for one. Don't get so bent out of shape.

Hunter
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1788
    
    2
I was planning on coming back to it later on,


There is not time like the present. As soon as you accepted an answer on the other site you should have indicated that on this site. It would have taken an extra minute of your time to do this.

Why should the 5-10 people who read your question on this site first have to check with the other site to see if an answer has been found?

I will continue to get "bent out of shape" when you think that your time is more valuable than our time.
Hunter McMillen
Ranch Hand

Joined: Mar 13, 2009
Posts: 490

So the solution to this problem was how I was checking whether lines had comments, I was testing if a line contained comments, then only printing the line if the lines STARTED with comments, so lines like:



wont be printed because the line doesn't start with a comment.

Hunter
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Lines lost during reading of a file in JTextPane
 
Similar Threads
Selective retrieval of numbers in a text file
Extracting integers from a string.
How to keep formatting while reading files
Syntax highlighting in JTextPane
need exception