java.net.ConnectException



When i run the following code, i get - java.net.ConnectException:
Connection refused

import java.net.URL;

import javax.swing.JDialog;
import javax.swing.JEditorPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLFrameHyperlinkEvent;

public class EditorPaneTest {

EditorPaneTest()
{
JEditorPane edit = new JEditorPane();
String str = "<html><body><A href=http://
www.google.co.in>Googly</A></body></html>";
edit.setContentType("text/html");
edit.setText(str);
edit.setEditable(false);
edit.addHyperlinkListener(new Hyperactive());
JDialog disalog = new JDialog();
disalog.getContentPane().add(edit);
disalog.show();
}
public static void main(String args[])
{
new EditorPaneTest();
}
class Hyperactive implements HyperlinkListener {

public void hyperlinkUpdate(HyperlinkEvent e) {
System.out.println("hyper link update");
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
{
JEditorPane pane = (JEditorPane) e.getSource();
if (e instanceof HTMLFrameHyperlinkEvent) {
HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e;
HTMLDocument doc = (HTMLDocument)pane.getDocument();
doc.processHTMLFrameHyperlinkEvent(evt);
} else {
try {
pane.setPage(e.getURL().getHost());
} catch (Throwable t) {
t.printStackTrace();
}
}
}
}
}
}

I dont know if i have to configure anything or start any service. I am
running this from Eclipse in Linux platform. Can anyone please explain
what i need to do?

.