Question 1 The method __________ sets the background color to yellow in JFrame frame. Question 1 options: setBackground(Color.YELLOW) frame.setBackGround(Color.yellow) setBackground(Color.yellow) frame.setBackground(Color.YELLOW) Question 2 What layout manager should you use so that every component occupies the same size in the container? Question 2 options: FlowLayout any layout BorderLayout GridLayout Question 3 Which of the following statements is for terminating the program when closing the frame? Question 3 options: frame.setDefaultCloseOperation(null) frame.setDefaultCloseOperation(JFrame.TERMINATE_ON_CLOSE) frame.setDefaultCloseOperation(JFrame.STOP_ON_CLOSE) frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) Question 4 Which of the following statements about containers is correct? Question 4 options: Both frames and panels can be placed inside a panel A panel can be placed inside a panel A frame can be placed inside a panel A frame can be placed inside a frame Question 5 Which method call puts the string “Result” into the TextField named result? Question 5 options: result.findText() result.text(“Result”) result.newText(“Result”) result.setText(“Result”) Question 6 How many items can be added into a JComboBox object? Question 6 options: 0 1 Unlimited 2 Question 7 What kind of object is used group radio buttons? Question 7 options: Group ButtonGroup JButtonGroup ContainerGroup Question 8 Which of the following method calls is used to prevent the user from modifying a text field tf? Question 8 options: tf.setUneditable() tf.setEditable(false); tf.preventMdification() tf.setChangable(false); Question 9 When you want to allow the user to select only one of several choices, which you use? Question 9 options: Text fields Ordinary buttons Radio buttons Check boxes Question 10 What is the benefit of using layout managers? Question 10 options: It reduces the amount of code needed It defines how components of a window should be arranged when it is resized It makes the program run much faster It reduces the amount of memory necessary to store the window components Question 11 Which of the following true about source and listener objects? Question 11 options: Both objects must be of the same type The objects must always be of different types They must always be different objects They can be the same object Question 12 Which of the following statements is incorrect? Question 12 options: A listener may listen for multiple sources The listener object’s class must implement the corresponding event-listener interface A source object can only have one listener object The listener object must be registered by the source object Question 13 Given the code below, indicate which statement describes its behavior. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Quiz3A extends JFrame implements ActionListener { public Quiz3A() { JButton okButton = new JButton(“OK”); add(okButton); } public void actionPerformed(ActionEvent e) { System.out.println(“The OK button is clicked”); } public static void main(String[] args) { JFrame frame = new Quiz3A(); frame.setSize(300, 300); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } } Question 13 options: The actionPerformed method is not executed when you click the OK button, because no instance of Quiz3A is registered with okButton The program has a compilation error because no listeners are registered for okButton The message The OK button is clicked is displayed when you click the OK button The program has a runtime error because no listeners are registered with okButton Question 14 The listener for an button event is an instance of ________. Question 14 options: KeyListener ActionListener MouseListener ItemListener Question 15 Which of the following statements registers a panel object aPanel as a listener for a button variable aButton? Question 15 options: aButton.addActionEventListener(aPanel); addActionListener(aPanel); aPanel.a…

Looking for solution of this Assignment?


We deliver quality original papers

Our experts write quality original papers using academic databases.We dont use AI in our work. We refund your money if AI is detected  

Free revisions

We offer our clients multiple free revisions just to ensure you get what you want.

Discounted prices

All our prices are discounted which makes it affordable to you. Use code FIRST15 to get your discount

100% originality

We deliver papers that are written from scratch to deliver 100% originality. Our papers are free from plagiarism and NO similarity.We have ZERO TOLERANCE TO USE OF AI

On-time delivery

We will deliver your paper on time even on short notice or  short deadline, overnight essay or even an urgent essay