• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

applets: From memory to applets viewer

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
am completely new to the world of java
am working on the project to dispaly apache server status.
I was able to access the file from a remote site as shown below
can anyone help me as to how to pass the information htmlPage(BufferedReader type)from buffer to an applet, so that i can view the information in an applet,rather than Console i/o.
I appreciate inadvance
Here is my code.
import java.net.*;
import java.io.*;
import java.util.*;
class masreader3 {
public static void main(String[] args) throws Exception {
String dataLine;
String masString;
//Get URL object
URL masapache = new URL("http://myserver/server-status/";);
//Open a connection to the URL and get a
// URLConnection object.
URLConnection urlConnection = masapache.openConnection();
//Use the connection to get and display the URL
//Use the connection to get and display the date last
// modified.
Date lastModified = new Date(
//Use the connection to get and display the content
// type.
//Use the connection to get an InputStream object.
// Use the InputStream object to instantiate a
// DataInputStream object.
BufferedReader htmlPage =
new BufferedReader(new InputStreamReader(
//Use the DataInputStream object to read and display
// the file one line at a time.
while((dataLine = htmlPage.readLine()) != null){
}//end while loop
}//end try
catch(UnknownHostException e){
"Must be online to run properly.");
}//end catch
catch(MalformedURLException e){System.out.println(e);}
catch(IOException e){System.out.println(e);}
}//end main
}//end class masreader2

Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic