🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #7669

Hyper Links on JEditorPane with Frames

#7669
From: Prashanth Reddy
Date: Fri, 22 Dec 2000 07:44
74 lines
3297 bytes
Hello,

    We are using  the HTMLEditorkit and JEditorpane to develop customized
browser component.

    We need to send the Session Id value that comes from Webserver to the
Log file on click of any hyperlink
    present in the HTML Page that has Frames.

    We are able to send the SessionID to the Server Log file,if the HTML
page is without Frames.But we are
    not able to send SessionID if the HTML page is with Frames.

   The code we are using is as below.

  void jEditPane_hyperlinkUpdate(HyperlinkEvent hyperEvt)
  {
    try
    {
      sMailTo = hyperEvt.getURL().toString();
      String sCmd=null;
       if (sMailTo.startsWith("mailto:")
&&(hyperEvt.getEventType()==HyperlinkEvent.EventType.ACTIVATED) )
    {
    this.setCursor(new Cursor(Cursor.WAIT_CURSOR ));
    try
    {
       sCmd= Constants.WIN_PATH+" "+Constants.WIN_FLAG+" "+sMailTo;
       Process procMailTo = Runtime.getRuntime().exec(sCmd);
    }
    catch (IOException ioEx)
    {
      VCMsgDlg.vcShowMsg(ioEx.getMessage(),"Error",MsgConstants.ERROR);
    }
     this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
 }
 else if (hyperEvt.getEventType()== HyperlinkEvent.EventType.ACTIVATED)
 {
    this.setCursor(new Cursor(Cursor.WAIT_CURSOR ));
    JEditorPane jEdPane = (JEditorPane) hyperEvt.getSource() ;
       if (hyperEvt instanceof HTMLFrameHyperlinkEvent)
       {
  HTMLFrameHyperlinkEvent htmlFrEvt = (HTMLFrameHyperlinkEvent) hyperEvt;
                sMailTo=htmlFrEvt.getURL().toString();
                System.out.println(sMailTo);
  HTMLDocument htmlDoc = (HTMLDocument) jEdPane.getDocument();
  htmlDoc.processHTMLFrameHyperlinkEvent(htmlFrEvt.);
       } // END of  if
       else
       {
                 if(VCBMain.customTP.sSessionID== null)
                 {
                   sMailTo=sMailTo;
                 }
              else
                 {
   sMailTo=sMailTo+"?VCSessionID="+VCBMain.customTP.sSessionID;
                 }
                sHyperURL =VCBMain.customTP.getLocalURL(sMailTo);
  System.out.println(sHyperURL) ;
  jEdPane.setPage(sHyperURL);
       }         this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
 }
    }
    catch (Exception exec)
    {
        exec.printStackTrace();
    }
  } // END of  jEditPane_hyperlinkUpdate(HyperlinkEvent hyperEvt)

Any help from your side?

Thanks iN Advance
Kaliga&Goud
Technical Details
Message-ID: <3a430687_2@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news-x.support.nl!newsfeeds.belnet.be!naxos.belnet.be!news.belnet.be!bornews.borland.com!dnews!202.160.239.6

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,e4eaa2d4d0e4927,start
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2000-12-21 23:46:03 PST
Reply-To: "Prashanth Reddy" <radtech@in-biz.net>
From: "Prashanth Reddy" <radtech@in-biz.net>
Newsgroups: borland.public.jbuilder.java.swing
Subject: Hyper Links on JEditorPane with Frames
Date: Fri, 22 Dec 2000 13:14:24 +0530
Lines: 76
Organization: RAD India
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: 202.160.239.6
Message-ID: <3a430687_2@dnews>
X-Trace: 21 Dec 2000 23:45:11 -0800, 202.160.239.6
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news-x.support.nl!newsfeeds.belnet.be!naxos.belnet.be!news.belnet.be!bornews.borland.com!dnews!202.160.239.6