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, 22.06.2019 10:30
Auniversity wants to install a client-server network. which feature do you think is important for them as they set up the network? sending email blocking multiple people to use the same file low security low set up cost limited access to files
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
What do character formats do for your document's message? a.set the tone b.provide organization c.provide clarity d.set how texts align with documents
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. sean is a computer programmer. he has programmed an application for toddlers that plays nursery rhymes. however, a logic error has occurred in the program. which problem is a likely consequence of the error? a. the program crashes every time the user wants to play the nursery rhymes. b. the program crosses its buffer boundaries and overwrites an adjacent program. c. the program plays a different nursery rhyme than the one the user intended to play. d. the program shows different structures in its programming language code. e. the program introduces new viruses every time the user plays a nursery rhyme.
Answers: 1
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
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
Mathematics, 27.01.2021 03:50
question
Mathematics, 27.01.2021 03:50
question
Mathematics, 27.01.2021 03:50
question
Mathematics, 27.01.2021 03:50
Questions on the website: 13722363