How to go to anchor html link from external html page in JEditorPane

Hi people,
I've been trying to jump to an anchor link from an external html page in JEditorPane, and I cannot get it working, I'm sure it can be done somehow...
The HTML page has a link like:
Hello
and this is loaded into JEditorPane ok.
The HyperlinkListener implementation:
public void hyperlinkUpdate( HyperlinkEvent e )
try {
if ( e.getEventType() == HyperlinkEvent.EventType.ACTIVATED )
editorPane_.setPage( getClass().getResource(
MyDialog.this.getBaseURL().concat( e.getURL().getFile().substring(
e.getURL().getFile().lastIndexOf( "/" ) + 1 ) ) ) );
if ( e.getURL().getRef() != null )
editorPane_.scrollToReference( e.getURL().getRef() );
else return;
} catch ( IOException ioe ) { ioe.printStackTrace(); }
This code loads the new html file ok, but it does not scroll to the anchor. The MyDialog.this.getBaseURL() just returns something like com.name.package, I construct the URL by using this base url and the name of the html file to open.
ANy help, thanks

he! I'm not alone in my desperation. Take a look at my problem:
I've got a JEditorPane (not editable) inside a JFrame. The JEditorPane is loaded with the HTML text and all the links to anchors are working properly when I click on them.
BUT
If I try to go to an anchor from outside this JFrame I can see how the JEditorPane scrolls to the right anchor and suddenly it scrolls back to the place where the caret was located!!!
The "funny thing" is that my code is working in jdk1.3.1 but this is happening in jdk1.4.2. Is it a bug?!?!?!
How could I figure out what position I have to set the caret to for every anchor in order to get the scroll working correctly???
My implementation of hyperlinkUpdate (working properly, here isn't the problem):
   jEditorPane.addHyperlinkListener(new HyperlinkListener() {
      public void hyperlinkUpdate(HyperlinkEvent e) {
        if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
          MiEditorPane src = (MiEditorPane)e.getSource();
          src.goToAnchor(e.getDescription().substring(1));
    });My object jEditorPane is an instance of this class:
  class MiEditorPane extends JEditorPane {
    MiEditorPane() {
      super();
    public void goToAnchor(String anchor) {
      super.scrollToReference(anchor);
  }And this is the method I call from outside the JFrame containing the JEditorPane:
  public void goToAnchor(String anchor) {
     jEditorPane.goToAnchor(anchor);
  }Any help greatly appreciated ...

Similar Messages

  • HTML link from external html page to link to a frame in swf

    Hi
    I am trying to set up something to should be fairly basic to
    do .. but I cannot get it to work.
    Need a link from another website to link to a frame label or
    number in my flash movie.
    Something like this ..
    <a href="mySwfPage.php?label=labelnamehere&">Click
    here</a>
    My guess it will not work because I have several stop
    functions and a preloader in the 1st frame not allowing the href
    link to jump to the frame name I want.
    Here is the page I am trying to apply this to -
    http://www.mloudesign.net/tampico/index.html
    We need for an external link to link to the espanol label so
    that would start first, otherwise the english version plays 1st.
    In case this helps this is the preloader I am using in frame
    #1 ..
    onClipEvent (load) {
    total = _root.getBytesTotal();
    onClipEvent (enterFrame) {
    loaded = _root.getBytesLoaded();
    percent = int(loaded/total*100);
    text = percent+"%";
    gotoAndStop(percent);
    if (loaded == total) {
    _root.gotoAndPlay(2);
    Any help would be much appreciated.
    Thanks!
    ~mlou

    he! I'm not alone in my desperation. Take a look at my problem:
    I've got a JEditorPane (not editable) inside a JFrame. The JEditorPane is loaded with the HTML text and all the links to anchors are working properly when I click on them.
    BUT
    If I try to go to an anchor from outside this JFrame I can see how the JEditorPane scrolls to the right anchor and suddenly it scrolls back to the place where the caret was located!!!
    The "funny thing" is that my code is working in jdk1.3.1 but this is happening in jdk1.4.2. Is it a bug?!?!?!
    How could I figure out what position I have to set the caret to for every anchor in order to get the scroll working correctly???
    My implementation of hyperlinkUpdate (working properly, here isn't the problem):
       jEditorPane.addHyperlinkListener(new HyperlinkListener() {
          public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
              MiEditorPane src = (MiEditorPane)e.getSource();
              src.goToAnchor(e.getDescription().substring(1));
        });My object jEditorPane is an instance of this class:
      class MiEditorPane extends JEditorPane {
        MiEditorPane() {
          super();
        public void goToAnchor(String anchor) {
          super.scrollToReference(anchor);
      }And this is the method I call from outside the JFrame containing the JEditorPane:
      public void goToAnchor(String anchor) {
         jEditorPane.goToAnchor(anchor);
      }Any help greatly appreciated ...

  • How can I create a working link from the home page to other pages?

    Using iWeb, I created links on the Home page directed to other pages within my web site. The links are located in the main body of the Home page (on the right side) and are not included in the Navigation Menu. The links function correctly when I test them in iWeb, however, the links do not function at all after publishing to the internet.
    Within the inspector, I have chosen, Link To: "One of my pages" and the appropriate page is selected.
    The links within the gray rectangles do not function. The same links below the gray rectangle links go to a "Page Not Found" page.
    See the home page at http://www.daleenstrom.com
    How can I make these links function correctly?

    Welcome to the Apple Discussions. I've found that using the "One of my pages" often doesn't work. Since you've published the site go to each page, copy its URL and use it for the hyperlink. I've found that to me more reliable.
    Are those two links inside the shapes or just on top? Both of those items are one large image file. If you inserted the link in the shape be sure you've selected the text (might take a few clicks to get inside and select it) to use for the hyperlink. Also make sure there are no other objects overlapping each of the shaped with the hyperlinked text.
    Also it appears that the entire text box is an image. Turn on iWeb's preferences to display the text image indicator:
    Click to view full size
    and then you'll see the following on any object that will be converted to text once published:
    Click to view full size
    The two links below work for me. Be sure to clear your browsers cache (CommandOptionE for Safari) and reload the page.
    OT

  • How to hide 'catalog','open',home' link from dashboard page in obiee11g ?

    Hi,
    how to hide 'catalog','open',home' link from dashboard page in obiee11g based one users/groups.
    http://imageshare.web.id/images/e7tosu6qtsa9zdl1a8w8.jpg
    i.e: some users shold not able to see 'open','catalog',home link from dashboard but some power user/groups can able to see the 'open','catalog',home link.
    Thanks
    Deva

    Hi,
    I don't want to remove totally, what i am asking is there any
    Possibility to do users/groups wise,
    E.x:
    Work around home page
    Setting home page each users/groups wise . I am expecting like that option to
    Do open and catalog link.
    Home link not a priority .
    http://obieeelegant.blogspot.com/2011/06/how-to-changing-theobiee11g-homepage.html
    Thank
    Deva
    http://obieeelegant.blogspot.com

  • How do I get my computer to "allow" a Java upload? It will not even accept the link from your support page.

    How do I get my computer to "allow" a Java upload? It will not even accept the link from your support page.

    Please post a screenshot that shows what you mean. Be careful not to include any private information.
    Start a reply to this message. Click the camera icon in the toolbar of the editing window and select the image file to upload it. You can also include text in the reply.

  • How can i connect my bookmarks links from Firefox, to favorites (location) start button then favorites?

    ''dupe of https://support.mozilla.org/en-US/questions/915455''
    How can i connect my bookmarks links from Firefox, to favorites (location) start button then favorites?

    *Plain old favorites: https://addons.mozilla.org/firefox/addon/plainoldfavorites/

  • The Help Link from the Application Pages Does not Work for Peoplesoft Campus Solutions 9.0

    Hi everyone.
    I have a problem, I have been trying to set up the Help Link from the Application Pages for Peoplesoft Campus Solutions 9.0 according to the instructions given in the Document: http://docs.oracle.com/cd/E17566_01/epm91pbr0/eng/psbooks/EnablingtheHelpLinkfromApplicationPages.pdf ,  (referenced in the Doc ID 1289101.1, E-PB: How to Set Up the Context Sensitive Help with Hosted PeopleBooks using Universal Linking).
    I follow the instructions of that document carefully:
    I go to: PeopleTools -> Web Profile -> Web Profile Configuration
        2. Then I choose the Web Profile: "Development".
        3. Then Change the value for the Help URL field by entering the following URL format: http://www.oracle.com/pls/topic/lookup?id=%CONTEXT_ID%&ctx=hrcs90r5 , the ctx parameter selected is the one that correspond to  the Campus Solutions (hrcs90r5) according to the Product Line Code Table (ULinkID) especified in the mentioned document.
        4. Stop the Web Domain and Clear cache.
        5. Start the Web Domain again.
    After setting up the Web Profile Configuration I test the help links, thas is why I click in the Help link in any Peoplesoft CS 9.0 Application Page (modify a person), but the next error message appears: "We're sorry, the topic you requested was not found.".
    I tried many combinations with the ctx parameters URL but it does not work yet. 
    I did the same test, but this time using the Help URL field with a HRMS ctx parameter by entering the following URL format: http://www.oracle.com/pls/topic/lookup?id=%CONTEXT_ID%&ctx=hcm92pbr5 , and It works fine !!!
    According to the previous test you realize that It works with HRMS ctx parameter but not with Campus Solutions 9.0 ctx parameter,  Does anybody know what else can I do ? Am I doing anything wrong or missing? or maybe the Oracle's ctx parameter for Campus Solutions URL It is broken simply.
    Thanks for you help and feedback.

    2799444 - The page you are testing with appears to be a Workforce Administration page. Is that correct?
    The CS PeopleBooks would only work for CS pages, e.g.: try navigating to Main Menu > Campus Community > Personal Information > Add/Update a Person
    Also, you can use multiple ctx parameters:
    E.g.: http://www.oracle.com/pls/topic/lookup?id=%CONTEXT_ID%&ctx=hrcs90r5&ctx=hcm92pbr5&ctx=pt852pbh2
    This way the help would work for the HR related pages like Workforce Administration, Campus Solutions pages like Campus Community and also PeopleTools pages like Web Profile Configuration. Hope this clarifies your question. Thanks!

  • Problem with a link from a seeded page

    I know that there has to be something stupid I am doing wrong here, but I cannot figure it out. I am trying to link from a seeded page to a custom page of mine.
    Here is my link:
    OA.jsp?page=/oracle/apps/ar/cusstd/localizationExt/webui/AcctLocalizationsPG&CustAccountId={@CustAcctId}&TabName=Tax&PartyId={@PrtyId}
    Here is part of the seeded page which contains the fields want to use in my link:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!-- dbdrv: exec java oracle/jrad/tools/xml/importer XMLImporter.class java &phase=dat+24 checkfile:~PROD:~PATH:~FILE &fullpath:~PROD:~PATH:~FILE -username &un_apps -password &pw_apps -dbconnection &jdbc_db_addr -userId "1" -rootPackage /oracle/apps/~PROD -rootdir &fullpath:~PROD:mds:directory -->
    <page xmlns:jrad="http://xmlns.oracle.com/jrad" xmlns:oa="http://xmlns.oracle.com/oa" xmlns:ui="http://xmlns.oracle.com/uix/ui" version="10.1.3_798" xml:lang="en-US" xmlns:user="http://xmlns.oracle.com/jrad/user" xmlns="http://xmlns.oracle.com/jrad" file-version="$Header: AcctOviewPG.xml 120.36.12000000.2 2007/06/28 13:23:19 nproddut ship $">
    <content>
    <oa:pageLayout id="PageLayoutRN" windowTitle="Customer Account" title="Customer Account" amDefName="oracle.apps.ar.cusstd.acctoview.server.AcctOviewAM" controllerClass="oracle.apps.ar.cusstd.acctoview.webui.AcctOviewPageCO" helpTargetAppShortName="ar" helpTarget="arugctcrua">
    <ui:corporateBranding>
    <oa:image id="corporateBrandingImage" source="/OA_MEDIA/FNDSSCORP.gif"/>
    </ui:corporateBranding>
    <ui:contents>
    <oa:stackLayout id="MainRN">
    <ui:contents>
    <oa:defaultDoubleColumn id="CustInfoRow" text="Customer Information">
    <ui:contents>
    <oa:messageStyledText id="CustName" destination="OA.jsp?OAFunc=AR_CUS_OVR&amp;HzPuiPartyId={!PartyId}" required="no" prompt="Name" styleClass="OraDataText" viewName="ArCustInfoVO1" viewAttr="PartyName"/>
    <oa:messageStyledText id="CustType" required="no" prompt="Customer Type" styleClass="OraDataText" viewName="ArCustInfoVO1" viewAttr="PartyType"/>
    <oa:formValue id="PrtyId" rendered="false" prompt="Paryt Id" dataType="NUMBER" viewName="ArCustInfoVO1" viewAttr="PartyId"/>
    <oa:formValue id="CustAcctId" rendered="false" prompt="Customer Account ID" viewName="ArCustInfoVO1" viewAttr="CustAccountId" dataType="NUMBER"/>
    <oa:formValue id="CustAcctProfileId" rendered="false" prompt="Customer Account Profile ID" viewName="ArCustInfoVO1" viewAttr="CustAccountProfileId" dataType="NUMBER"/>
    <oa:formValue id="AcctNum" rendered="false" prompt="Account Number" viewName="ArCustInfoVO1" viewAttr="AccountNumber"/>
    <oa:messageStyledText id="RegId" dataType="NUMBER" required="no" prompt="Registry ID" styleClass="OraDataText" viewName="ArCustInfoVO1" viewAttr="PartyNumber"/>
    <oa:messageStyledText id="Classfctn" prompt="Classification" styleClass="OraDataText" viewName="ArCustInfoVO1" viewAttr="CategoryCode" rendered="false"/>
    </ui:contents>
    </oa:defaultDoubleColumn>
    </ui:contents>
    </oa:stackLayout>
    I have tried using (@PartyId} , {@PrtyId} and ={@ArCustInfoVO1.PartyId} and all just get me "" as a value in my controller.
    What am I doing wrong here?
    Thanks,
    Greg

    Hi all -
    I'm quite stuck in a (somewhat) similar situation. We have a personalized page containing a link whose URL includes a variable ({@PersonId}). I modified the URL - big mistake - since there is no such variable as {@UserName}. Now when I try to navigate to the personalized page, it doesn't load at all - just returns an error page (the first line of which is this: oracle.apps.fnd.framework.OAException: oracle.jbo.NoDefException: JBO-25058: Definition UserName of type Attribute not found in EmployeeDetailsVO). I wouldn't have thought that a non-SYSADMIN user could break a page for all other users, but so it goes.
    Does anyone know how I might correct this problem? I figure there's someplace to change the URL and get rid of the ill-fated {@UserName} but darned if I know where or how.
    Here's a few details that seem like they might be helpful:
    Problem Description:
    - Page: (Barton, Jeffrey - /oracle/apps/per/selfservice/hierarchy/webui/MgrPrsnDetailsPG 120.1)
    - User (CBROWN)
    - Application (800 - PER - Human Resources)
    - Responsibility (54667 - LINE_MANAGER_ACCESS_V4.0 - Manager Self-Service)
    Personalizations:
    - Personalizations are (ENABLED)
    The following personalizations are effective on this page:
    - /oracle/apps/per/selfservice/hierarchy/webui/MgrPrsnDetailsPG (function/HR_PERSON_DETAILS_SS) (site/0)
    Oh, and I probably should note that this is EBS 12 - dunno if that is a given.
    thanks
    - John
    Edited by: user10123775 on Oct 27, 2008 4:48 PM

  • When I click on a link from a web page opened in Safari I get a blank black screen. Why can't I see the contents of the page?

    When I click on a link from a web page opened in Safari I get a blank black screen. Why can't I see the contents of the page?

    Is this any link in any page, or one particular link in a particular page?

  • FF 3.6.12 will not open links from external sources (Outlook, Dreamweaver, Digsby, etc)

    I have just upgraded to Firefox 3.6.12 and links clicked in an external source will not open in Firefox.
    Firefox is set as my default program for web browsing. I have tried to open links from Outlook, Dreamweaver, Digsby, and other programs.

    I have the same issue, opening links from external programs like Word or Thunderbird does not work. This used to work before the update to 3.6.12

  • I have Iphone 4, version 4.3.3 (8J2) How can i remove the brightness toolbar from the main page, below the applications above the shorcuts?

    I have Iphone 4, version 4.3.3 (8J2) How can i remove the brightness toolbar from the main page, below the applications above the shorcuts?

    There is no brightness toolbar unless your iPhone is jailbroken.  If so, you can try to restore to remove the JB.
    The only place brightness exists is under Settings.

  • When I try to access a web page or link from a web page I receive an error message like "Server not found" or "Unable to connect." After repeated "try again" attempts the page will load, but when I click on a button or link, the same thing repeats. Why?

    When I try to access any web page or any link from a web page, I receive an error message such as "Server not found" or "Unable to connect." After repeated "try again" attempts that the page will load, but as soon as I click on a button or link, the same thing repeats. Any suggestions?

    When I try to access any web page or any link from a web page, I receive an error message such as "Server not found" or "Unable to connect." After repeated "try again" attempts that the page will load, but as soon as I click on a button or link, the same thing repeats. Any suggestions?

  • How to import a maintenance task list from external system to R3

    Is there a bapi or a fm can import the maintenance task list (equipment ,function location ,generic) from external system to R3.

    Hello,
    how to import task list to sap from external system
    Hope this helps.
    Regards, Murugesh AS

  • How do I raise a Business Event from a OAF page?

    Hello,
    I am developing a custom system using the OAF and need to raise a custom Business Event, which in turn will have a subscription to launch a workflow process.
    How do I raise a Business Event from a OAF page ?
    Can I use the classes in oracle.apps.fnd.wf.bes.* ?
    Any help would be highly appreciated.
    Best Regards,
    Andries Hanekom

    Hi,
    When I try to compile just the basic part of my class I receive the following error:
    Error(21,36): cannot access class javax.jms.TextMessage; file javax\jms\TextMessage.class not found
    Class Code:
    import oracle.apps.fnd.wf.bes.BusinessEvent;
    public class VscmsEvents
    public VscmsEvents()
    public static void main(String[] args)
    VscmsEvents vscmsEvents = new VscmsEvents();
    //Initialize BusinessEvent, Payload objects
    public void initEvent(String eventName, String eventKey, String eventData)
    //Create BusinessEvent Object
    BusinessEvent mEvent = new BusinessEvent(eventName, eventKey);
    Furthermore, when using the BusinessEvent object to raise the event I will need to provide the raise method with a java.sql.Connection parameter. In the context of a OAF page how will I perform this?
    Thanks for the help.
    Best Regards,
    Andries Hanekom

  • How to remove all of the tags from a HTML file

    Hi all,
    I am developing a search program.
    User will enter a word or some text in a textfield and after click on go button it will search the word from the html file which is reside in c: drive.
    What I am trying to do is -- reading file and storing data/contents of the file in a String and so on............then store in a Vector.....so on.......
    My question is ----- how can I remove all of the html tags such as: <p>, <b>,</b> <h1>, <strong>, or whatever from the String (where I store the data/contents of the html file) or from a HTML file.
    I would appreciate sample code if anyone has any.
    please help me in this way.
    Thanks in advance
    Thanks a lot.
    amitindia

    Hi dear,
    I got the link and have found examples.
    thanks for solving my problem.
    Thanks for your prompt reply.
    amitindia
    India

Maybe you are looking for