How can I active link in JEditorPane
I wana active my link on README.HTML file to going up down in my file or go to another html file here is my code:
import javax.swing.*;
import java.awt.*;
import java.io.*;
publicclass EditorPaneEx
{
public EditorPaneEx()
{
JEditorPane editorPane1 =new JEditorPane();
editorPane1.setEditable(false);
java.net.URL helpURL = TextSamplerDemo.class.getResource("README.html");
if (helpURL !=null)
{
try
{
editorPane1.setPage(helpURL);
}
catch (IOException e)
{
System.err.println("Attempted to read a bad URL: " + helpURL);
}
}
else
{
System.err.println("Couldn't find file: README.html");
editorPane1.setText("Error. Unable to load README.html file.");
}
JScrollPane editorScrollPane =new JScrollPane(editorPane1);
editorScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
editorScrollPane.setPreferredSize(new Dimension(250, 145));
editorScrollPane.setMinimumSize(new Dimension(10, 10));
//JEditorPane editorPane2 = new JEditorPane("text/html", "<b>Help</b>");
//editorPane2.setEditable(false);
JFrame aFrame =new JFrame("JScrollPane TEST");
aFrame.setSize(400, 350);
//aFrame.getContentPane().add(editorPane2, BorderLayout.NORTH);
aFrame.getContentPane().add(editorScrollPane);
aFrame.setVisible(true);
aFrame.setLocationRelativeTo(null);
aFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
publicstaticvoid main(String[] args)
{
new EditorPaneEx();
}
}
I must input somthing like this:
class Hyperactiveimplements HyperlinkListener{
publicvoid hyperlinkUpdate(HyperlinkEvent e){
but I can't understand how exacly make it work, plz If someone know the solution send the code. thank you for your time.

