Writing Java Application Code | Module 2

Course Name: Writing Java Application Code (Java as a Second Language Specialization)

Course Link: Writing Java Application Code

These are Writing Java Application Code Week 2 Coursera Answers


Q1. Which of the following are not a set of class files for Java Windows development?

  • Swing
  • Abstract Windows Toolkit (AWT)
  • Java Utils

Answer: Java Utils


Q2. A JFrame components is an example of _________ .

  • a Close button
  • a Scrollbar
  • a class
  • A base Window

Answer: A base Window


Q3. Which methods sets a component’s position?

  • add
  • locate
  • setBounds
  • grid

Answer: Please .


Q4. Which component is the best fit for multiline text?

  • JTextArea
  • Dialog
  • JButton
  • JLabel

Answer: Please .


Q5. Calling setText(String str) method on a JTextField, will set the contents to __________ .

  • null
  • Returns an error
  • Clears the JTextField
  • The value for String str

Answer: Please .


These are Writing Java Application Code Week 2 Coursera Answers


Q6. With method enables a JFrame to close when the X in the upper right hand corner is clicked?

  • System.exit
  • setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
  • No method
  • close

Answer: Please .


Q7. True or False: a JPanel is an example of a container class.

  • True
  • False

Answer: Please .


Q8. User actions are handled in which method?

  • addPerformed(ActionEvent e)
  • event()
  • onClick
  • Run()

Answer: Please .


Q9. True or False: Only one component on a Java window can listen for user action.

  • True
  • False

Answer: Please .


Q10. Which method allows a components to listen for user action?

  • addActionListenListener()
  • takeActions()
  • addEventListener()
  • newUserActionsListen()

Answer: Please .


These are Writing Java Application Code Week 2 Coursera Answers


More Weeks of the course: Click Here

More Coursera courses: https://progiez.com/coursera

Writing Java Application Code Week 2 Coursera Answers
The content uploaded on this website is for reference purposes only. Please do it yourself first.