This is from documentation: dispose()-> "Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. That is, the resources for these Components will be destroyed, any memory they consume will be returned to the OS, and they will be marked as undisplayable. " But is that not the work of garbage collector? I hav not understood the words. Please help. Thanx in advance
The garbage collector deals with the memory allocated to Objects, not native screen resources. The OS deals with the system resources. The dispose() method tells the OS that the app is finished with the resources.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Originally posted by Yin Ming: if a frame been disposed, can it restart again?
No, but you can create another one.
Marilyn de Queiroz
Joined: Jul 22, 2000
Originally posted by Ajit B: can u gimme examples of System resources, thx in advance.........Ajit
Processes and stuff the native OS provides to the Java program at a lower level. For example, the frame itself. Java tells the OS, "Give me a Frame", and the OS gives one to use. Java doesn't actually draw the Frame on the screen and color it in and create the fonts. It uses what is already available to it.