Created
October 21, 2012 10:28
-
-
Save Cellane/3926638 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void readFile () { | |
FileReader fileReader; | |
FileDialog fileDialog = new FileDialog (new Frame (), "Open File", FileDialog.LOAD); | |
String fileName, line; | |
fileDialog.setVisible (true); | |
if (fileDialog.getFile () != null) { | |
fileName = fileDialog.getDirectory () + fileDialog.getFile (); | |
input.setText (""); | |
try { | |
fileReader = new FileReader (fileName); | |
input.read (fileReader, fileDialog.getFile ()); | |
} catch (IOException ioe) { | |
ioe.printStackTrace (); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment