use of jmri.jmrix.loconet.spjfile.SpjFile in project JMRI by JMRI.
the class LoaderPane method doRead.
void doRead() {
if (inputFileName.getText().equals("")) {
JOptionPane.showMessageDialog(this, res.getString("ErrorNoInputFile"), res.getString("ErrorTitle"), JOptionPane.ERROR_MESSAGE);
return;
}
// force load, verify disabled in case read fails
loadButton.setEnabled(false);
loadButton.setToolTipText(res.getString("TipLoadDisabled"));
try {
file = new SpjFile(chooser.getSelectedFile());
file.read();
} catch (FileNotFoundException f) {
JOptionPane.showMessageDialog(this, res.getString("ErrorFileNotFound"), res.getString("ErrorTitle"), JOptionPane.ERROR_MESSAGE);
return;
} catch (IOException f) {
JOptionPane.showMessageDialog(this, res.getString("ErrorIOError"), res.getString("ErrorTitle"), JOptionPane.ERROR_MESSAGE);
return;
}
// display contents
comment.setText(file.getComment());
// set up for next step
loadButton.setEnabled(true);
loadButton.setToolTipText(res.getString("TipLoadEnabled"));
status.setText(res.getString("StatusDoDownload"));
}
Aggregations