Complete this code fragment to ensure that the application exits properly when the user closes the frame:
JFrame frame = new JFrame() ;
A) frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;
B) JFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;
C) JFrame.setCloseOperation(JFrame.EXIT) ;
D) frame.setCloseOperation(JFrame.EXIT) ;
Correct Answer:
Verified
Q44: User-interface components are arranged by placing them
Q45: Consider the following code snippet:
JPanel panel =
Q47: When drawing complex shapes, make a separate
Q48: Which java package must be imported if
Q48: Which java package must be imported if
Q51: To draw an ellipse, you must include
Q52: The Graphics class is part of the
Q53: Which of the following statements is correct?
A)
Q68: The _ method should be called whenever
Q95: You have a class that extends the
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents