• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

online help document problem

 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
I can display the help html file. But when i move the mouse over the hyper link, i can't click and the mouse arrow doesn't change to the 'little hand'?
could anyone give me suggestion?
URL helpURL=new URL(documentationURL);
JEditorPane editorPane = new JEditorPane();
editorPane.setContentType("text/html");
editorPane.setPage( helpURL );
editorPane.setEditable(false);
JScrollPane helpScrollPane = new JScrollPane(editorPane);

Container contentPane = menuMain.getContentPane(); // menuMain is a JFrame
contentPane.removeAll();
contentPane.add( helpScrollPane );
menuMain.show();
thanks
stephen
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure, try an editorPane.setEditable(true)?
 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Kalichar,
thanks!
I tried but it doesn't work.
Can anyone give other suggestion? I'm really confused.
stephen
 
Rajesh Matti
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not an expert on this subject, but I think you need to add a HyperlinkListener to enable clicking on the hyperlinks. Hope that helps.
 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Rajesh,
I added HyperlinkListener, but it still doesn't work.
HyperlinkListener sounds like to process the problem about frame
I'll continue to try. Any comments are welcomed!
stephen
 
Rajesh Matti
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephen- I did exactly what is metnioned in the documetation of JEditorPane and it did work.
 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Rajesh,
Maybe i have something wrong. I'll try it again.
Wait for my good news.
thank you very much!
stephen
 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Rajesh
I figure it out. But i still have a little problem.
How to make the shape of mouse changes from arrow to a litte hand like a real browser does when the mouse move over a hyper link?
I don't know which method should be used.
thanks for any comments!
stephen
 
Rajesh Matti
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
stephen- HyperlinkListener gets events for ENTERED, EXITED and ACTIVATED. Use ENTERED, EXITED events to modify the cursor of the event.getSource().
Hope this helps.
-Rajesh
 
Kuan Fan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Rajesh,
It works. I catch that event and invoke the setCursor method.
thans for your suggestion! thank you very much!
stephen
 
Rajesh Matti
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan - No problems at all, You are welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic