• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Route Finder Front End

 
xpealia dogious
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
I've written a route finder in Java over the past few weeks that runs from a command prompt by reading in a text file of attractions and then calculating the shortest route between a specified two.
the problem is that i'm having REAL trouble trying to design a front-end, indeed i'm not even sure where to start !!
my e-mail address is: rudeboylatham@hotmail.com
if anyone would be kind enough to e-mail me or send me a pm to get the source code and then help me in some how designing even a basic front end i would be eternally grateful !!!
thanks in advance,
yours hopefully,
Tom Latham
 
Brian Pipa
Ranch Hand
Posts: 299
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you tell us what kind of data you want to show/retrieve from the user and/or what you were thinking of, perhaps we could offer some suggestions on how to implement it. You haven't given us enough info to really help you and most people won't email you directly. This is a forum - give us some info so we can help!
Brian
 
xpealia dogious
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know sorry.... this is getting very frustrating.
the data given at command line in the working version are three strings (the filename, start point and destination point)
the text file is a list of various vertices on the network in the form of the attraction name, it's neighbour, the edge between them and the distance....
here's some of the code:
this is a method in the Swing form that runs after being loaded from a splash screen:

it then runs this method in the main ShortPath program file which is only a part of the whole ShortPath class:

however, when i try to run the program before having entered any data it comes up with an error message saying "Error Reading attractions2.txt"
any ideas for this ?? is what i'm trying to achieve even possible ??
thanks in advance
[ April 07, 2004: Message edited by: xpealia dogious ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All that the error message you are getting means is that whatever the method "loader(f)" does has failed...

You need to change your IOException catch block to print out the stack trace of the error to figure out exactly where and exactly what is causing the error... all you need to do is add the line "e.printStackTrace();" inside the IOException catch block. Then you will have some idea of what the actual problem is...
 
xpealia dogious
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the error it gives is just the same error as the else clause in the if loop following the code in the ShortPath class given above:
the if loop is:
if ( findShortestPath( roads, s, d) )
displayPath( roads, s, d );
else
System.out.println( "The path does not exist. Please check spelling." );
- any ideas ??
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not post the actual error message and stack trace?

Otherwise we're just guessing at what the problem is...
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic