subject

Here are some statements in a program that sets up some GUI controls. The idea is that the user will type a number into the text field and, after that, press the button when s/he wants the program to read-in that number:

// set up a button that, when pressed, will read what's in the text field.
btnRead = new JButton("Read the Number");
// set up a text field that will read a number when enter is hit.
txtNumber = new JTextField("0.0", 15);

If we want the button event to cause the number in the text field to be read by the program when either the button is pressed or the text field is modified and the enter key was hit, we will need to: (Check all that apply. There may be more than one.)
A) add an ActionListener to btnRead (among other things).
B) from inside the txtNumber ActionListener method definition, we will need to refer to the btnRead control in some statement or statements.
C) from inside the btnRead ActionListener method definition we will need to refer to the txtNumber control in some statement or statements.
D) add an ActionListener to the txtNumber (among other things).
E) add an ActionListener to only the btnRead but not to txtNumber.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:00
Which statement is true of web-based social media? a.they allow consumers to interact with and update content. b.they cannot be updated easily, as compared to print media. c.they are expensive to produce and maintain, as compared to print and television. d.they can exist independent of the internet.
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
Monica and her team have implemented is successfully in an organization. what factor leads to successful is implementation? good between different departments in an organization leads to successful is implementation.
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
question
Computers and Technology, 23.06.2019 22:00
Technician a says engine assemblies can be mounted longitudinally in a chassis. technician b says engine assemblies can be mounted transversely in a chassis. who is correct?
Answers: 2
You know the right answer?
Here are some statements in a program that sets up some GUI controls. The idea is that the user will...
Questions
question
Computers and Technology, 14.07.2019 21:00
question
Spanish, 14.07.2019 21:00
question
Arts, 14.07.2019 21:00
Questions on the website: 13722367