Re: ActionListener scoping



it is highly bizarre. But if Java refuses to let you pass paramaters to
an ActionListener, or return anything, or modify local method
variables, forces me to make my little method temp. variable a class
variable, or find a much less elegant way to change that variable when
I want it's change to be based on an event in the GUI.

I don't really understand what you mean by the method not running when
the event is triggered. Essentially I have a method which creates a
JDialog, reads some input from it, disposes of the JDialog, and tosses
that data off to an object of another class entirely. As the dialog is
also local to the method, the ActionListner would never be called
outside that method. I suppose I can see how an object of one of these
classes could outlive it's parent method, but that seems like the less
common case to me, the more common case being the object dying along
with its parent method. In this case, of course, I don't see how the
fact that its a method scoped variable matters, as its still just the
parent scope for the object, just as the class scoped variables are
accessable by the method since the class scope is the method's parent
scope.

I suppose it makes more sense to me to assume that people would be
smart enough to not try and access variables in a scope that no longer
exists, rather then eliminate the possibility entirely because the
parent scope *MIGHT* no longer exist.

.



Relevant Pages

  • Re: define_method in inheritance
    ... This opens up the scope of a given class so any other class could add ... into a parent and then invoke it on a child would the new method be ... David A. Black / Ruby Power and Light, ...
    (comp.lang.ruby)
  • Re: limiting search scope
    ... index server. ... Here's what I have set up to filter my 'parent' folder ... index service and to limit the scope of the search. ...
    (microsoft.public.inetserver.indexserver)
  • Re: Object scope issue...
    ... So, the "update" method on the Parent class, inserts or updates parent ... What I was doing in my "Save" command button code was setting the parent ... I only do a database update. ... Is this typically how one would control an objects scope - by setting as ...
    (microsoft.public.dotnet.languages.vb)
  • Re: What objects must I clean up to avoid memory leaks?
    ... >Under DOS, it sufficed to let things fall out of scope at which point ... reference to the Parent ...
    (microsoft.public.vb.general.discussion)