JEditorPane: HTML show with simple navigate without mouse

Discussion in 'Java' started by Romano Signorelli, Jul 31, 2003.

  1. Hello,
    I would like to use JEditorPane to make a simple HTML viewer with browsing
    support, through use of keyboard (NO MOUSE).
    I will use it to display some little help pages in HTML format.

    With the keyboard, I would like to:
    - Scroll the page up/down (example: arrow up/down)
    - Highlight the links on the page, one by one, by selecting it with, for
    example, arrow left/right
    - Jump to the link highlighted (e.g.: Enter key)
    - Return to the previous page (e.g.: ESC key)

    So, upon loaded an HTML page in the JEditorPane, I've started to get
    information about the links (a href) located on it.
    I've got the dest. links throught the HTMLDocument, the iterator and
    AttributeSet.

    The big problem now is: how to locate exactly a link on the graphical page
    (x, y position) and how highlight it

    Tryied: I used a DefaultHighlighter with a simple g.drawRect(), but my
    rectangle seems to disappear when a new HTML page loads. Furthermore, I
    don't know how to locate exacltly the graphical position of a link to
    correctly draw a box around it (hightlight). In my tryes I've drawn it in a
    fixed position. This position will change dinamically (e.g.: when the page
    scroll, when selecting another link, etc).

    Any ideas? Please help me, if you can, about:
    - how to get information about a link on an HTML doc and highlight it on
    JEditorPane

    Thanks in advance, bye
    Romano Signorelli
     
    Romano Signorelli, Jul 31, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robin
    Replies:
    0
    Views:
    721
    Robin
    May 12, 2005
  2. tom arnall
    Replies:
    6
    Views:
    1,284
    Ian Shef
    Jan 18, 2007
  3. kelvin
    Replies:
    3
    Views:
    747
    Adrienne Boswell
    May 22, 2007
  4. Andrew Thompson
    Replies:
    4
    Views:
    480
    Andrew Thompson
    Oct 30, 2007
  5. news.frontiernet.net

    Simple Mouse-Over Show/Hide with Delay Javascript Need

    news.frontiernet.net, Jun 2, 2004, in forum: Javascript
    Replies:
    0
    Views:
    145
    news.frontiernet.net
    Jun 2, 2004
Loading...

Share This Page