Pass the location of a file to a method in java?
I'm trying to create an object that gets the location and sets an
jEditorPane to the contents of the located file.
Code:
File file = new File("Summary.html");
private void EditoPaneMethod(File file) {
frmRules.pack();
frmRules.setVisible(true);
edpRules.setEditable(false);
try {
edpRules.setPage(file.toURI().toURL());
} catch (IOException ex) {
Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null,
ex);
}
}
Could someone point me in the right direction?
No comments:
Post a Comment