Skip to main content

HContainer: update(), repaint(), setVisible(), requestFocus(), ...?

No replies
Joined: 2008-07-22
Points: 0

Can someone describe, or point to a doc that clarifies the interaction of these methods of HContainer and HScene? That is, which methods implicitly call the others? And how do these vary in implementations (best safely used for all devices not just the intended/spec behavior)?

update(), repaint(), setVisible(), requestFocus(), validate()

There are just enough of these methods and I've seen variations on how players render Containers that I'm uncertain. In practice I've been calling two or more (perhaps just in the wrong order, or calling at too-low a level). My limited awt know-how is part of my uncertainty to be sure...

a) Are update and repaint and validate implictly called by setVisible(boolean)?

b) Will requestFocus always setVisible(true) when needed?

c) When we add() or remove() or change attribs (font, color etc) of Containers inside another, are validate and repaint needed, or is there a preferred / higher level way to update a layout?

d) Does validate() implicitly call repaint (relates to #a and #c)?

e) Does setVisible(true) call validate()? If not should validate be called before setVisible(true) or after?

f) Do there methods behave differently on a HScene, vs Components inside it?

Any knowledge is greatly appreciated!

Message was edited by: ken2006