Thanks Justin and Paul, the ProgressMonitorInputStream really is a lot
tidier but still wasn't painting it's popup properly until I used the
SwingWorker. The combination of both is working great.

Much appreciated,
Ewan

--------------------------------------------------------------------

    Ewan Borland
    Computing Science
    University of Glasgow

    email : [EMAIL PROTECTED]
              [EMAIL PROTECTED]

--------------------------------------------------------------------


Paul Byrne wrote :

>Hi Ewan,
>
>Without more details it's hard to give a definitive answer to your problem.
>
>But I suspect it's actaully a Swing thread issue and nothing to do with
>Java3D. The issue is documented well on java.sun.com, search for
SwingWorker.
>
>Rgds
>
>Paul


----- Original Message -----
From: "Justin Couch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 17, 2002 11:44 PM
Subject: Re: [JAVA3D] JProgressBar not showing


> Ewan Borland wrote:
>
> > I've implemented a loader for a Java3D app I've got but it's very
important
> > for me to get some kind of progress monitor. Bearing in mind the Loader
> > interface doesn't support such I opted for the approach of using a
>
>
> I think a better way to do this is re-organise how your loader obtains
> the stream. For example, the way this is most often performed is to have
> the stream send stuff to a notifier (Swing has a
> ProgressMonitorInputStream for this purpose).
>
> Your loader code, when it has to load something, can ask a factory for
> the input stream. So something like this:
>
> public Scene load(URL url) {
>    URLConnection conn = url.openConnection();
>    InputStream is = conn.getInputStream();
>    InputStream source = MyStreamFactory.getProgressStream(is);
>
>    // do stuff with the source stream
> }
>
> This way you can separate the loader code from the stream handling.
>
> Of course, you can always implement the loader so that all load()
> methods except the one that takes a pre-built stream is ignored. That
> way you can pass it a custom stream that does all the progress
> notification yourself.
>
> --
> Justin Couch                         http://www.vlc.com.au/~justin/
> Freelance Java Consultant                  http://www.yumetech.com/
> Author, Java 3D FAQ Maintainer                  http://www.j3d.org/
> -------------------------------------------------------------------
> "Humanism is dead. Animals think, feel; so do machines now.
> Neither man nor woman is the measure of all things. Every organism
> processes data according to its domain, its environment; you, with
> all your brains, would be useless in a mouse's universe..."
>                                                - Greg Bear, Slant
> -------------------------------------------------------------------
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff JAVA3D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to