• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to DIFFERENTIATE the HYPERLINKS !!  RSS feed

 
manish basotia
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends
I am creating an Editor for reading/Editing RTF & HTML Files. Which is working fine. But I want to read the attributes of HYPERLINKS present in an WEB PAGE. What i mean is say if a user wants to read the attributes of an HYPERLINK . He should right click that particular Hyperlink and select some Option say READ ATTRIBUTES, on this event the user must be able to see all the ATTRIBUTES of that particular HYPERLINK. I am able to do this to a certain extent, and below is the code for that.
But the problem with code is i am not able to differentiate the HYPERLINKS. Which ever HYPERLINK i read first , for rest of the HYPERLINKS the reading remains the same, that is why i am making the objects null every time.
Please let me know how can i achieve this. I have used JTextPane.
Remember that i cant depend on giving a unique ID to each of the HYPERLINKS as user should be able to read any HTML, and most of the time we dont give ID to it.
Waiting for your reply
Manish Basotia
==================================================================================
HTMLDocument.Iterator htmiterator = null;
AttributeSet a=null;
Enumeration enump= null;
// this code is working fine
htmiterator = ((HTMLDocument)hdoc).getIterator(HTML.Tag.A);
a = htmiterator.getAttributes();
System.out.println("Attributes are "+a.getAttributeCount());
enump = a.getAttributeNames();
while(enump.hasMoreElements())
{
Object obj = enump.nextElement();
System.out.println("Attributes are "+obj.toString()+" and value is :"+a.getAttribute(obj).toString());
}
==================================================================================
Edited to remove pointless Very Urgent from subject.
[ April 19, 2004: Message edited by: Gregg Bolinger ]
 
manish basotia
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
still waiting. Ok i can solve this if anyone tell me how do i convert the mouse postion into offSet using jdk1.3
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!