Multiple choice

What is the component that provides a box for writing one line of text in a GUI application?

  1. JTextField

  2. JMultiLineField

  3. JLabelField

  4. JTextArea

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

JTextField is the standard Swing component used for accepting a single line of text input from a user. JTextArea is used for multiple lines, and JLabel is for display only.