//************************************** //**** saving / retrieve //************************************** void saveBrowser() { // provided by Robert Hutson JFileChooser browser = new JFileChooser(); int returnVal = browser.showSaveDialog(null); String saveFile = null; if(returnVal == JFileChooser.APPROVE_OPTION) { //did you click 'save' or 'cancel'? try { saveFile = browser.getSelectedFile().getCanonicalPath(); //we want the full path name of file } catch (IOException ioe) { } catch (Exception e) { /*some other error occured*/ }; if (saveFile != null) { //sometimes it pays to be redundant... savePts(saveFile); } } } void loadBrowser() { //the user wants to load in a file now... JFileChooser browser = new JFileChooser(); int returnVal = browser.showOpenDialog(null); String loadFile = null; if(returnVal == JFileChooser.APPROVE_OPTION) { //did you click 'open' or 'cancel'? try { loadFile = browser.getSelectedFile().getCanonicalPath(); //we want the full path name of the file } catch (IOException ioe) { } catch (Exception e) { /*some other error occured*/ }; if (loadFile != null) { //sometimes it pays to be redundant... loadPts(loadFile); } } } void savePts(String fullFileName) { String [] inppts = new String [vn+1]; int s=0; inppts[s++]=str(vn); for (int i=0; i