terminating applet-process

Discussion in 'Java' started by Georg Andersson, Jun 8, 2004.

  1. hi

    i have written a little web-application that is used for browsing our
    aerial image database. for every record in the database, 6 images are
    loaded from the db and shown in the page. on of this images is loaded
    inside an applet due to some graphics that are created dynamicly and
    laid over the image. the image is not imported directly by the applet.
    it's saved to disc first using a php-script and then loaded with the
    applet.
    on the web-page, there's a 'next' and a 'back' button, which enables
    the user to browse through the database.

    the problem is: the image inside the applet is not updated when the
    user browses through the database. i guess i would have to 'terminate'
    the applet-process and removing it from the RAM befor reloading the
    applet.

    does anyone have any experiences or ideas about this problem?

    best regards

    georg
    Georg Andersson, Jun 8, 2004
    #1
    1. Advertising

  2. On 8 Jun 2004 01:06:58 -0700, Georg Andersson wrote:

    > the problem is: the image inside the applet is not updated when the
    > user browses through the database.


    You might find the methods destroy()
    <http://java.sun.com/j2se/1.4.2/docs/api/java/applet/Applet.html#method_summary>
    and it's associated method init(),
    are not just handy, but indeed custom
    built for these times.

    A couple of other notes..
    GUI problems are best discussed in..
    <http://www.physci.org/codes/javafaq.jsp#cljg>
    ...but beginner problems should really go..
    <http://www.physci.org/codes/javafaq.jsp#cljh>

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, Jun 8, 2004
    #2
    1. Advertising

  3. Hi Andrew

    tx for your help.

    >
    > You might find the methods destroy()
    >


    i've overritten the destroy-method to set all variables of my applet
    to 'null'. but still, the displayed image in the applet remains the
    same. so i tried 'system.exit', but this terminates internet explorer.

    once again: the applet loads an image ("image.jpg" on c:\temp). this
    image changes as soon as the user clicks on a button. so, the php-page
    containing the applet is reloaded. the idea would be: the applet
    displays the new image. but this never happens. it allways shows the
    previous image. even, if the image on c:\temp is removed, the applet
    keeps displaying it.

    so, the image must be stored in such way, that it can't be accessed by
    applet.destroy()...

    any ideas how to solve this?
    Georg Andersson, Jun 9, 2004
    #3
  4. On 9 Jun 2004 05:12:53 -0700, Georg Andersson wrote:
    ...
    (A.T.)
    >> You might find the methods destroy()

    ...
    > i've overritten the destroy-method to set all variables of my applet
    > to 'null'. but still, the displayed image in the applet remains the
    > same. so i tried 'system.exit', but this terminates internet explorer.


    *What*?!? That does not gel with
    a) common sense, or..
    b) my experience with calling System.exit(0) in in applet*

    * I hava an applet that launches applications,
    when the apps. call System.exit(0) (as they might
    commonly do) the Plug-In throws all sorts of
    NotInThisSecurityManagerThankYouVeryMuchException's
    [ yes ..it's a long one. ;-) ]

    > once again: the applet loads an image ("image.jpg" on c:\temp). this
    > image changes as soon as the user clicks on a button.

    .....
    > any ideas how to solve this?


    SSCCE
    <http://www.physci.org/codes/sscce.jsp>

    Oh, and give us an URL..

    What I would be *particularly* interested to see
    is any applet that can shut down the browser in
    which it resides..

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, Jun 9, 2004
    #4
  5. Georg Andersson

    Roedy Green Guest

    On 9 Jun 2004 05:12:53 -0700, (Georg
    Andersson) wrote or quoted :

    >so, the image must be stored in such way, that it can't be accessed by
    >applet.destroy()...


    Are you removing as well as nullifying? Nullifying has no effect on
    visibility. The removing is what you need from the point of view of
    visibility.

    Is the browser ever calling your destroy method?

    Put in some code to monitor when it calls init, start, stop and
    destroy.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jun 9, 2004
    #5
  6. Georg Andersson

    Roedy Green Guest

    On Wed, 09 Jun 2004 16:40:57 GMT, Andrew Thompson
    <> wrote or quoted :

    >* I hava an applet that launches applications,
    >when the apps. call System.exit(0) (as they might
    >commonly do) the Plug-In throws all sorts of
    >NotInThisSecurityManagerThankYouVeryMuchException's
    >[ yes ..it's a long one. ;-) ]


    Maybe in signed Applet it lets you crash the browser.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jun 9, 2004
    #6
  7. Georg Andersson wrote:

    > hi
    >
    > i have written a little web-application that is used for browsing our
    > aerial image database. for every record in the database, 6 images are
    > loaded from the db and shown in the page. on of this images is loaded
    > inside an applet due to some graphics that are created dynamicly and
    > laid over the image. the image is not imported directly by the applet.
    > it's saved to disc first using a php-script and then loaded with the
    > applet.
    > on the web-page, there's a 'next' and a 'back' button, which enables
    > the user to browse through the database.
    >
    > the problem is: the image inside the applet is not updated when the
    > user browses through the database. i guess i would have to 'terminate'
    > the applet-process and removing it from the RAM befor reloading the
    > applet.
    >
    > does anyone have any experiences or ideas about this problem?


    Do your "next" and "back" buttons cause the browser to do page reloads,
    or do they just perform Javascript magic to load new images into the
    existing document? If the latter then the only likely avenue of
    approach is via Java / Javascript interoperation. If the latter, then
    make sure the updated page retrieved in response to a "back" or "next"
    contains the correct value for the parameter(s) that the applet uses to
    load the correct file.

    Do provide that example that Andrew asked for if you can't work out the
    problem with what you've gotten so far.


    John Bollinger
    John C. Bollinger, Jun 9, 2004
    #7
  8. On Wed, 09 Jun 2004 20:45:46 GMT, Roedy Green wrote:
    > On Wed, 09 Jun 2004 16:40:57 GMT, Andrew Thompson
    >
    >>* I hava an applet that launches applications,
    >>when the apps. call System.exit(0) (as they might
    >>commonly do) the Plug-In throws all sorts of
    >>NotInThisSecurityManagerThankYouVeryMuchException's
    >>[ yes ..it's a long one. ;-) ]

    >
    > Maybe in signed Applet it lets you crash the browser.


    Good point. (But I would still consider
    that a Java bug). Is it signed, Georg?

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, Jun 10, 2004
    #8
    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. Wayne Marrison

    Terminating a process tree

    Wayne Marrison, Nov 8, 2004, in forum: Java
    Replies:
    9
    Views:
    3,461
    John C. Bollinger
    Nov 9, 2004
  2. Ike

    Terminating an Applet

    Ike, Feb 17, 2006, in forum: Java
    Replies:
    1
    Views:
    342
    Chris Smith
    Feb 17, 2006
  3. Earl Eiland

    terminating an inactive process

    Earl Eiland, Apr 2, 2005, in forum: Python
    Replies:
    1
    Views:
    378
    fred.dixon
    Apr 2, 2005
  4. Trent Mick

    Re: terminating an inactive process

    Trent Mick, Apr 4, 2005, in forum: Python
    Replies:
    1
    Views:
    338
    fred.dixon
    Apr 5, 2005
  5. Replies:
    13
    Views:
    888
    Willy Denoyette [MVP]
    Apr 19, 2007
Loading...

Share This Page