Purpose of invalidate and validate methods

Explain the purpose of invalidate and validate methods

The invalidate method is called as a side effect of an addition or deleting some component. calling invalidate() is however the first step of processing a COMPONENT_RESIZED event.

validate() checks if a container is valid or not.
It calls layout or validateTree to calculate the exact positions and sizes of all the contained components.
validate() also decides the new size and location of a component in the container.
What are AWT peers? When are peers created and destroyed?
What are AWT peers? - A Component is associated with a standard AWT button object, a peer object (hidden button object internal to the native GUI)...
Explain how to create a borderless window with an example
Explain how to create a borderless window public static void main(String[]args)....
Show with an example the usage of FileDialog object
Usage of FileDialog object - class FileDialog extends from Dialog class. It is used to display a dialog window from which the user can select a file...
Post your comment