Ok hello all, I am still learning Java and just messing about with some things, I made a GUI and have a JEditorPane to display a webpage when the "Go" button is pressed.
Code that won't work:
private void goActionPerformed(java.awt.event.ActionEvent evt) {
String URL = url.getText();
JEditorPane.setEditable(false);
try {
JEditorPane.setPage("www.google.com");
}catch (IOException e) {
JEditorPane.setContentType("text/html");
JEditorPane.setText("<html>Could not load " + URL);
}
}
Anyhelp is welcome thanks!