• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Help me to solve these problems in JEditorPane

 
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I was trying to use JEditorPane and was able to sucessfully use same except two problems:
1. When mouse comes over the link it doesnot change to "hand cursor". DoI have to use customise cursor? pl help me. if possible can you provide me code snppet.
2. now when a html page comes into the pane and if I click at a button provided in the page it gives me error.
Regards,
Arun
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Arun,
try this.
public void hyperlinkUpdate(HyperlinkEvent evt)
{
//Swing itself doesn't change the cursor when mouse moves over the link. so
if (evt.getEventType() == HyperlinkEvent.EventType.ENTERED) {
JEditorPane pane = (JEditorPane) evt.getSource();
// Enter event. Go the the "hand" cursor and fill in the status bar
pane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
else if (evt.getEventType() == HyperlinkEvent.EventType.EXITED) {
JEditorPane pane = (JEditorPane) evt.getSource();
// Exit event. Go back to the default cursor and clear the status bar
pane.setCursor(Cursor.getDefaultCursor());
}
else if (evt.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
{
//....
}
 
Danger, 10,000 volts, very electic .... tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic