🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Display HTML text

#18409
From: Geoff Austin
Date: Fri, 26 Jun 1998 00:00
37 lines
1347 bytes
I would like to display html pages withing a text area on a dialog to
support help and other options.

Does anybody have an example? I'm looking for something like:


  private void go() {

    String urlString = txtUrl.getText();

    try {
        URL url = new URL(urlString);
        }
        catch (MalformedURLException ex) {
              taDisplay.setText("Bad URL");
            }
    if (url == null) {
       taDisplay.setText("URL is null");
       return;
    }

    try {
        Object obj = url.getContent();
        }
        catch (IOException ex) {
              taDisplay.setText("IO Error");
              }
  }


I have tried above but url is always null, i.e. if(url == null) always
returns true.

Any feedback would be appreciated.

Geoff
Technical Details
Message-ID: <6mvsmf$kf2$1@ubnnews.unisource.ch>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,6cc3bea77c2f3d43
X-Google-Attributes: gidf74b3,public
From: "Geoff Austin" <austin.geoff@pmintl.ch>
Subject: Display HTML text
Date: 1998/06/26
Message-ID: <6mvsmf$kf2$1@ubnnews.unisource.ch>
X-Deja-AN: 366258783
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
X-Complaints-To: news@ubnnews.unisource.ch
X-Trace: ubnnews.unisource.ch 898856463 20962 (None) 194.209.91.2
Organization: Unisource Business Networks
Newsgroups: borland.public.jbuilder.java.language