×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Arie Claassens
Added: Dec 20, 2014 12:11 PM
Views: 1852
Tags: no tags
  1. /* Original code - switched to using code rolled on my own
  2.          int returnVal = jFileChooser.showOpenDialog(this);
  3.          if (returnVal == jFileChooser.APPROVE_OPTION) {
  4.          File file = jFileChooser.getSelectedFile();
  5.          try {
  6.          // What to do with the file, e.g. display it in a TextArea
  7.          //textarea.read( new FileReader( file.getAbsolutePath() ), null );
  8.          //FileReader inputFile = new FileReader(file.getAbsolutePath());
  9.          //System.out.println("File opened fine -> " + inputFile);
  10.          store.setData(io.readData(inputFile));
  11.                
  12.          } catch (IOException ex) {
  13.          System.out.println("Problem accessing file" + file.getAbsolutePath());
  14.          }
  15.          } else {
  16.          System.out.println("File access cancelled by user.");
  17.          }
  18.          */