Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Dubbio visibilità oggetti

    Salve. Avrei un dubbio da esporvi. Mettiamo caso che io abbia un JFrame con all'interno un JTextField, e questo JTextField abbia un ActionListener. Mettiamo che questo JFrame che contiene questo JTextField sia impostato in modo che alla chiusa venga effettuato un richiamo a dispose(). Il JTextField e il suo relativo ActionListener, vengono eliminati dalla memoria oppure vi rimangono?

  2. #2
    Utente di HTML.it L'avatar di Metflar
    Registrato dal
    Apr 2007
    Messaggi
    790

    Re: Dubbio visibilità oggetti

    Originariamente inviato da Dreamer89
    Salve. Avrei un dubbio da esporvi. Mettiamo caso che io abbia un JFrame con all'interno un JTextField, e questo JTextField abbia un ActionListener. Mettiamo che questo JFrame che contiene questo JTextField sia impostato in modo che alla chiusa venga effettuato un richiamo a dispose(). Il JTextField e il suo relativo ActionListener, vengono eliminati dalla memoria oppure vi rimangono?
    dalla documentazione
    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.

    The Window and its subcomponents can be made displayable again by rebuilding the native resources with a subsequent call to pack or show. The states of the recreated Window and its subcomponents will be identical to the states of these objects at the point where the Window was disposed (not accounting for additional modifications between those actions).
    conoscenze: C/C++, Java, PHP, Python
    [No PM tecnici o di qualsiasi genere]

  3. #3
    Grazie mille ^^

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.