Is there a Java.Swing equivalent to AS3's ADDED_TO_STAGE event? -
in as3, there event listens when object added stage. useful cases where, example, variables not set until added on-screen. waiting until object has been added, can assure of variables set.
is there equivalent in swing? example, have function relies on objects getwidth function. obviously, if seek phone call before object added on screen, function have problems because width zero. function called component added , has width. in as3, like:
mycomponent.addeventlistener(event.added_to_stage, myfunction).
how in java?
depending on setup, componentlistener
might enough. there a section in java tutorials componentlistener
s.
another way of initializing stuff displayed overriding paintcomponent
method , performing setup on first invocation.
java swing
No comments:
Post a Comment