• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Anchor for HyperLinks in Swing

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
How can I use html refernce(anchor) for links in Swing...

and also, can i use the requestFocus() method for a panel inside another panel.
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
your first question: if you want to display html and hyperlinks, use JEditorPane. The API provides examples for loading html pages.
your second question: requestFocus() works only if the component that requests focus is visible. use the ancestor listener to listen when its added to its ancestor. by this time it should be visible.
chantal
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai,
Seems like you have a very nice problem. But are u using JEditor pane through out, for all your html pages in that case u get the anchor in that by itself. Maybe u are mixing panes and HTML
 
vidya archana
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i ma using editor pane, but my problem is, thr r two separate panels .. in the left panel i am giving the links and on clicking the link, correspondong section in the right panel needs to be shown.. can to help?
 
allen turner
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This does not seem to be a problem of the Editor pane. But your desing seems to be having some problem. you seem to want to navigate a set of panels using a HTML page on a JEditor pane. Maybe u must change it a little bit and try loading the panels dynamically or use some gridlayout and put the required panel on the first grid in response to a click.
hope that helps
 
vidya archana
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but in such a case, i have to reload the whole thing each time, no? is thr any alternative like setting the focus to that panel on each click? we r dynamically generating the panels.
 
mooooooo ..... tiny ad ....
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic