Results 1 to 2 of 2
Thread: Buffered reader
- 02-02-2011, 05:46 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 1
- Rep Power
- 0
Buffered reader
Hey, I need some help with some code part, my task in our project is to make a program that can read a LOC-file for a GPS, and this is my code so far, I've made a Jfilechooser so far that can take only LOC-files but I don't know how to create a buffered reader that can read the LOC-file and translate it in for the GPS, can anyone help me with this? this is my code so far ..
import javax.swing.*;
public class ReadGeo {
private static String fileChooser(){
JFileChooser jfc = new JFileChooser();
jfc.setAcceptAllFileFilterUsed(false);
jfc.setDialogTitle("Filechooser");
jfc.setFileFilter(new javax.swing.filechooser.FileNameExtensionFilter("L OC files", "loc"));
int resultat = jfc.showOpenDialog(null);
if (resultat != JFileChooser.APPROVE_OPTION){
JOptionPane.showMessageDialog(null, "You didnt pick a file");
System.exit(0);
}
String filnamn = jfc.getSelectedFile().getAbsolutePath();
return filnamn;
}
public static void main(String[] args){
String jfgf = fileChooser();
System.out.println(jfgf);
}
}
- 02-02-2011, 07:16 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
How does your loc file looks like. Please give us an example. Probably its an xml file/format then you could use an XML Parser(e.g. JDOM) instead of using BufferedReader an manually parsing the file. Generally, I would recommend to use the Scanner class instead of the BR for manually parse
And what do you mean with translate? :confused:
Similar Threads
-
Buffered Reader and scanners
By nevermiind in forum New To JavaReplies: 8Last Post: 05-04-2010, 06:22 PM -
Buffered Reader
By ilovepolluting in forum New To JavaReplies: 2Last Post: 02-04-2010, 09:16 AM -
Buffered Reader problem
By pradeep.theonlyone in forum New To JavaReplies: 3Last Post: 07-31-2009, 11:37 AM -
Buffered Reader Exception
By hitmen in forum New To JavaReplies: 6Last Post: 01-07-2009, 11:14 AM -
FileReader / Buffered Reader
By sepaht in forum New To JavaReplies: 9Last Post: 07-10-2008, 08:05 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks