wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Route Finder Front End Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Route Finder Front End" Watch "Route Finder Front End" New topic
Author

Route Finder Front End

xpealia dogious
Greenhorn

Joined: Apr 05, 2004
Posts: 3
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

Joined: Sep 29, 2003
Posts: 299
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


My Java Freeware:<br />MACCC - <a href="http://maccc.pipasoft.com" target="_blank" rel="nofollow">http://maccc.pipasoft.com</a><br />Nator - <a href="http://nator.pipasoft.com" target="_blank" rel="nofollow">http://nator.pipasoft.com</a>
xpealia dogious
Greenhorn

Joined: Apr 05, 2004
Posts: 3
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

Joined: Oct 18, 2000
Posts: 4121

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...


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
xpealia dogious
Greenhorn

Joined: Apr 05, 2004
Posts: 3
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

Joined: Oct 18, 2000
Posts: 4121

Why not post the actual error message and stack trace?

Otherwise we're just guessing at what the problem is...
 
 
subject: Route Finder Front End