public void actionPerformed(ActionEvent e) {
JEditorPane note = new JEditorPane();
//Handle open button action.
if (e.getActionCommand().equals("New File")) {
int returnVal = fc.showOpenDialog(UpLoadListener.this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
file = fc.getSelectedFile();
try {
Content = file.toURI().toURL();
if (Content != null) {
try {
note.setContentType("text/html");
note.setPage(Content);
} catch (IOException e1) {
System.err.println("Attempted to read a bad URL: " + Content);
}
} else {
System.err.println("Couldn't find file");
}
}
catch (MalformedURLException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
}
}
}