Anonymous
Anonymous asked in Computers & InternetProgramming & Design · 9 years ago

java JFrame.EXIT_ON_CLOSE?

what is the difference between JFrame.EXIT_ON_CLOSE and JFrame.DISPOSE_ON_CLOSE?

which one do i need to use and when?

5 Answers

Relevance
  • 9 years ago
    Favorite Answer

    EXIT_ON_CLOSE will exit your program, vs DISPOSE_ON_CLOSE which will just close that JFrame. So if you have a program that has a main window and can make child windows you would want the main to EXIT_ON_CLOSE which would kill your program, and the children to DISPOSE_ON_CLOSE so that only that child window is closed, your program keeps running, and the main window stays open

  • 7 years ago

    Dispose closes the JFrame and clears up the memory while Exit closes the main window when the JFrame is closed by clicking on close button...

  • alcime
    Lv 4
    4 years ago

    Jframe.exit_on_close

  • Anonymous
    7 years ago

    don't know what to answer

  • How do you think about the answers? You can sign in to vote the answer.
  • 9 years ago

    k ok

Still have questions? Get your answers by asking now.