Bookmark Topic Watch Topic
  • New Topic

scanning then running an applet

 
Johnny Smither
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Report post to moderator
So this is probably pretty simple but I can't seem to figure it out. My teacher wants us to write a code that scans a text file, then outputs some text based information AND displays an applet bar graph of the data sorta like this for the text:

Sample Bar Graph

1-10 |*****
11-20 |******
21-30 |**
31-40 |*
41-50 |***********
51-60 |******
61-70 |********
71-80 |***
81-90 |****
91-100 |****

and then an applet thats the same info just a little more graphic. My code interprets the input well, but when i try to make an applet output, the code basically forgets all of my variables and starts anew (when i just state the public static graphic (paint) class after everything) OR it refuses to scan the input file (if i switch the public class from main.....throw ExceptionIO to just public class graphic(paint))

If this is confusing ill try to explain better. also i know my code isnt 100% complete in the applet section yet

Also, as a side note, if someone could tell me if theres a way to have java automatically determine how many separate lines there are in a text file without me having to manually count them, thatd be great



 
Campbell Ritchie
Sheriff
Posts: 51332
86
  • Mark post as helpful
  • send pies
  • Report post to moderator
Welcome to the Ranch

You appear to have posted the same thing twice, so I shall close this thread; please continue all discussion here.
 
    Bookmark Topic Watch Topic
  • New Topic