subject
Computers and Technology, 25.12.2019 03:31 ming8

Stringset yet again

attached files:

file stringsetguiframes. zip (86.121 kb)

in several labs we've written classes that stored and analyzed string objects. the inheritance lesson had stringset revisited and writing classes better had the original stringset. use one of these previously written classes in this program (it doesn't really matter which--they do the same thing).

write a widgetview application. create a class stringanalysis.

this class has an event handler inner class extending widgetviewactionevent

it has instance variables
stringset sset

jtextfield inputstr

jlabel numstr

jlabel numchar

in the constructor,
create a widgetview object

create sset

create a local variable jlabel prompt initialized to "enter a string"

create inputstr with some number of columns

create a local variable jbutton pushme initialized to "push to include string"

create numstr initialized to "number of strings: 0"

create numchar initalized to "number of characters: 0"

create an event handler object and add it as a listener to pushme

add prompt, inputstr, pushme, numstr and numchar to your widgetview object.

your event handler should add inputstr's contents to sset and set inputstr to "". it should update numstr
and numchar labels to contain sset's current information.

note: the same event handler that handles button pushes can, with no modification, handle the key
for a jtextfield. for the adventurous, use inputstr's addactionevent method to add your event handler.
(you can use the same object you added to pushme--you don't even have to create a new one). then run
your program, enter text in the inputstr field, and press the enter key.

note 2: in the writing classes lesson, the anatomy of a java program item said " often want to use
the business logic in multiple contexts. we might want a text-based we might want to also use it
in a graphical user interface (gui), and we'll write things like that before the course is over."
we've just made good on that promise. the stringset class (no matter which incarnation of stringset you
choose to use) was written as part of a text application. we've now incorporated it into a gui application
with no changes at all. in fact, if our development environment was sophisticated enough, we wouldn't even
recompile it. our gui app picked up the stringset class for free.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What side length would you specify if you were required to create a regular hexagonal plate that was composed of 33 cm(squared) of sheet metal? dimension the side length to 0.1 cm
Answers: 2
question
Computers and Technology, 23.06.2019 09:00
What provides an array of buttons for quick access to commonly used commands and tools
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. which step can possibly increase the severity of an incident? a. separating sensitive data from non-sensitive data b. immediately spreading the news about the incident response plan c. installing new hard disks d. increasing access controls
Answers: 2
You know the right answer?
Stringset yet again

attached files:

file stringsetguiframes. zip (86.121...
Questions
question
Mathematics, 20.02.2021 08:00
question
Mathematics, 20.02.2021 08:00
question
Social Studies, 20.02.2021 08:00
question
English, 20.02.2021 08:00
Questions on the website: 13722361