how to make pictures in progress show

Discussion in 'Java' started by wnstnsmith@yahoo.com, Aug 15, 2003.

  1. Guest

    Dear all,

    Perhaps this is a stupid question, but I cannot find the answer, so please
    help:

    In a java-application (not an applet), a series of pictures is processed. In
    one corner of the application window there is a jpanel PEEP which should
    show each picture as it is in the works, just to make the user happy that
    the work is indeed being done.
    The problem is that my picutres are duly processed, only the PEEP panel is
    not repainted for each new picture that goes into the mill. Instead, it is
    only repainted at the end of the whole loop, showing the last processed
    picture.
    Yes, the repaint instruction is in the loop, like this:

    void process(img[] series) {
    for (int i = 0; i < series.length; i++) {
    PEEP.setPicture (series); //this puts the picture in PEEP
    PEEP.repaint();
    doWhatIsNeededWith(series);
    }
    }

    what's wrong? tia.

    WS
     
    , Aug 15, 2003
    #1
    1. Advertising

  2. wrote:

    > Thanks, but yes, I'm doing it from an event, i.e. in response to a
    > buttonclick. (indeed, the button stays "pressed" all the time, that's
    > another thing I don't much like but don't know how to get around).
    > Second, a lot is done to these pics, so the process is quite slow. One would
    > expect there to be ample time for the system to update the window.
    >
    > WS


    T\The event thread is the one that will draw your changes and draw the
    button unpressed. If your using the event thread for your own nefarious
    purposes, it can't do any of those things it's suipposed to do. You need
    to do your stuff in a seperate thread.
     
    David Zimmerman, Aug 16, 2003
    #2
    1. Advertising

  3. Guest

    I get it. Thanks a lot!

    WS
     
    , Aug 16, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg Cyrus

    Show pictures in database on Webform

    Greg Cyrus, Oct 7, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    376
    ESPN Lover
    Oct 7, 2004
  2. aa
    Replies:
    1
    Views:
    526
    Ken Cox [Microsoft MVP]
    Nov 5, 2004
  3. Charlie Zhang
    Replies:
    3
    Views:
    1,340
    Paul Lutus
    Aug 16, 2004
  4. ©®
    Replies:
    5
    Views:
    672
    Lauri Raittila
    Jul 22, 2003
  5. Martin Raychev
    Replies:
    1
    Views:
    305
    Alvin Bruney [MVP]
    Mar 2, 2004
Loading...

Share This Page