[2025] in java-interest

home help back first fref pref prev next nref lref last post

Re: Displaying a Gif...

daemon@ATHENA.MIT.EDU (Mentor)
Fri Sep 22 02:41:22 1995

Date: Fri, 22 Sep 1995 00:06:41 -0400 (EDT)
From: Mentor <mentor@io.org>
To: Karl Asha <karl@one.net>
cc: "'java-interest@java.sun.com'" <java-interest@java.sun.com>
In-Reply-To: <01BA8838.0131D8A0@hades.blackdown.org>

On Thu, 21 Sep 1995, Karl Asha wrote:

> Would anyone care to show some sample code to simply display a gif
> in a -standalone- java program. Not an applet. 

It's simpler than you'd think: First, you set up a window (there's code in the
archives from rizzoti.sven@ch.swissbank.com which tells how).  Then, you haul
in the image with one of the following:

  String nice_image = "http://www.io.org/~mentor/images/moose.gif";

  // one way:
  Object o = (new URL(nice_image)).getContent();

  // second way:
  GifImage i = new GifImage(nice_image);

  // third way (more complex, but more general):
  URL url = new URL(nice_image);
  InputStream in = url.openStreamInteractively();
  Object o = url.getContent(in, null);


Cheers,
  David Forster
  Mentor Software Solutions
  <a href="http://www.io.org/~mentor">Mentor Software Solutions</a>

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post