Solved

Consider the Following Code Snippet

Question 74

Multiple Choice

Consider the following code snippet:
Final RectangleComponent component = new RectangleComponent() ;
MouseListener listener = new MousePressListener() ;
Component.addMouseListener(listener) ;
______________
Mystery.add(component) ;
Mystery.setSize(FRAME_WIDTH, FRAME_HEIGHT) ;
Mystery.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;
Mystery.setVisible(true) ;
Which of the following statements completes this code?


A) JPanel mystery = new JPanel() ;
B) JComponent mystery = new JComponent() ;
C) Frame mystery = new Frame() ;
D) JFrame mystery = new JFrame() ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions