Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
3rd Edition
ISBN: 9780134038179
Author: Tony Gaddis, Godfrey Muganda
Publisher: PEARSON
Expert Solution & Answer
Book Icon
Chapter 13, Problem 1MC
Program Description Answer

The method that is used to make the text field readable is “setEditable”.

Hence, correct answer is option “D”.

Expert Solution & Answer
Check Mark

Explanation of Solution

Read-only text field:

  • The text that can be changed only with the application code is called as read-only text field.
  • The read-only text field will not allow the user to edit its contents.
  • The usage of the “JTextField” component is made in a different way such that the text field cannot be edited by the user, instead it can be modified using the code of the application and it is made through the method “setEditable”

Format of defining the “setEditable” method:

The general format for defining “setEditable” method is given below:

  setEditable(boolean editable)

Example:

The usage of the method “setEditable” for the text field that is generated is given below:

//create a new text field

JTextField Total=new JTextField(10);

//set the text field read only

Total.setEditable(false);

Hence, the method that is used to make the text field readable is “setEditable”.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Appointment Class Requirements The appointment object shall have a required unique appointment ID string that cannot be longer than 10 characters. The appointment ID shall not be null and shall not be updatable. The appointment object shall have a required appointment Date field. The appointment Date field cannot be in the past. The appointment Date field shall not be null.Note: Use java.util.Date for the appointmentDate field and use before(new Date()) to check if the date is in the past. The appointment object shall have a required description String field that cannot be longer than 50 characters. The description field shall not be null. Appointment Service Requirements The appointment service shall be able to add appointments with a unique appointment ID. The appointment service shall be able to delete appointments per appointment ID.
Travel Tickets Company sells tickets for airlines, tours, and other travel-related services. Because ticket agents frequently mistype long ticket numbers, Travel Tickets has asked you to write an application that indicates invalid ticket number entries. The class prompts a ticket agent to enter a six-digit ticket number. Ticket numbers are designed so that if you drop the last digit of the number, then divide the number by 7, the remainder of the division will be identical to the last dropped digit. Accept the ticket number from the agent and verify whether it is a valid number. Test the application with the following ticket numbers: . 123454; the comparison should evaluate to true . 147103; the comparison should evaluate to true . 154123; the comparison should evaluate to false Save the program as TicketNumber.java.
In the class String, the substring method inserts a String into another String. -True or -False

Chapter 13 Solutions

Starting Out with Java: From Control Structures through Data Structures (3rd Edition)

Ch. 13.6 - Prob. 13.11CPCh. 13.8 - Briefly describe each of the following menu system...Ch. 13.8 - Prob. 13.13CPCh. 13.8 - Prob. 13.14CPCh. 13.8 - Prob. 13.15CPCh. 13.8 - Prob. 13.16CPCh. 13.8 - What class do you use to create a menu? What do...Ch. 13.8 - What class do you use to create a menu bar?Ch. 13.8 - Prob. 13.19CPCh. 13.8 - Prob. 13.20CPCh. 13.8 - Prob. 13.21CPCh. 13.8 - Prob. 13.22CPCh. 13.9 - Prob. 13.23CPCh. 13.9 - Prob. 13.24CPCh. 13.9 - Prob. 13.25CPCh. 13.9 - Prob. 13.26CPCh. 13.9 - Prob. 13.27CPCh. 13.9 - Prob. 13.28CPCh. 13.10 - Prob. 13.29CPCh. 13.10 - Prob. 13.30CPCh. 13 - Prob. 1MCCh. 13 - Prob. 2MCCh. 13 - Prob. 3MCCh. 13 - Prob. 4MCCh. 13 - Prob. 5MCCh. 13 - Prob. 6MCCh. 13 - Prob. 7MCCh. 13 - Prob. 8MCCh. 13 - Prob. 9MCCh. 13 - Prob. 10MCCh. 13 - Prob. 11MCCh. 13 - Prob. 12MCCh. 13 - Prob. 13MCCh. 13 - Prob. 14MCCh. 13 - Prob. 15MCCh. 13 - Prob. 16MCCh. 13 - Prob. 17MCCh. 13 - Prob. 18MCCh. 13 - Prob. 19MCCh. 13 - Prob. 20MCCh. 13 - Prob. 21MCCh. 13 - Prob. 22TFCh. 13 - Prob. 23TFCh. 13 - Prob. 24TFCh. 13 - Prob. 25TFCh. 13 - Prob. 26TFCh. 13 - Prob. 27TFCh. 13 - Prob. 28TFCh. 13 - Prob. 29TFCh. 13 - Prob. 30TFCh. 13 - Prob. 31TFCh. 13 - Prob. 32TFCh. 13 - Prob. 33TFCh. 13 - Prob. 34TFCh. 13 - Prob. 35TFCh. 13 - Prob. 1FTECh. 13 - Prob. 2FTECh. 13 - Prob. 3FTECh. 13 - Prob. 4FTECh. 13 - Prob. 5FTECh. 13 - Prob. 6FTECh. 13 - Prob. 7FTECh. 13 - Prob. 1AWCh. 13 - Prob. 2AWCh. 13 - Prob. 3AWCh. 13 - Prob. 4AWCh. 13 - Prob. 5AWCh. 13 - Write code that stores the image in the file...Ch. 13 - Prob. 7AWCh. 13 - Prob. 8AWCh. 13 - Prob. 9AWCh. 13 - Prob. 10AWCh. 13 - Write the code that creates a menu bar with one...Ch. 13 - Prob. 12AWCh. 13 - Prob. 1SACh. 13 - Prob. 2SACh. 13 - Prob. 3SACh. 13 - Prob. 4SACh. 13 - Prob. 5SACh. 13 - Prob. 6SACh. 13 - Prob. 7SACh. 13 - Prob. 8SACh. 13 - Prob. 9SACh. 13 - Prob. 10SACh. 13 - Prob. 11SACh. 13 - Prob. 12SACh. 13 - Prob. 1PCCh. 13 - Prob. 2PCCh. 13 - Dorm and Meal Plan Calculator A university has the...Ch. 13 - Skateboard Designer The Skate Shop sells the...Ch. 13 - Shopping Cart System Create an application that...Ch. 13 - Prob. 8PCCh. 13 - Prob. 9PC
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT