🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7760

Re: JTextPane URL won't update

#7760
From: Tami Poupko
Date: Wed, 23 May 2001 19:26
41 lines
2057 bytes
use jTextPane1.revalidate(); and than
      jTextPane1.repaint();

Bernie wrote:

> After loading an HTML page into a JTextPane from disk,
> subsequent loads using .setPage do not display the new
> HTML page, and the first one loaded remains displayed.
> The contents of the HTML file (myfile.html) on disk is
> updated, yet the page displayed in the JTextPane remains
> the same.  I have a  hyperLinkUpdate, so I'm not sure why
> it isn't displaying subsequent pages.  What do I have to do
> to get the JTextPane to display additional HTML pages?
>
> -Thanks
>
> void jButton1_actionPerformed(ActionEvent e) {
>     try {
>       ParseURLData(vLines);
>       WriteHTMLFile(userDir + "/myfile.html", vPage);
>       URL url = new URL("file:" + userDir + "/myfile.html");
>       jTextPane1.setPage(url);
>       jTextPane1.repaint();
>     }
>     catch(Exception ex) {
>       ex.printStackTrace();
>     }
>
>   }
>
>   void jTextPane1_hyperlinkUpdate(HyperlinkEvent e) {
>
>     try {
>       if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
>         jTextPane1.setPage(e.getURL());
>     }
>     catch (IOException ex) {
>       ex.printStackTrace(System.err);
>     }
>
>   }
Technical Details
Message-ID: <3B0C0EDB.2C159AA1@udscorp.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-03!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
References: <3B09DA6F.F5486D1B@att.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,4f978b5de2a94040
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-05-23 10:36:03 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-03!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: Tami Poupko <Poupko@udscorp.com>
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: JTextPane URL won't update
Date: Wed, 23 May 2001 12:26:19 -0700
Organization: Ultramar Diamond Shamrock
Message-ID: <3B0C0EDB.2C159AA1@udscorp.com>
Reply-To: Poupko@udscorp.com
X-Mailer: Mozilla 4.5 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
References: <3B09DA6F.F5486D1B@att.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: newsabuse@supernews.com
Lines: 42