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, 23.06.2019 10:20
Suppose there is a relation r(a, b, c) with a b+-tree index with search keys (a, b).1. what is the worst-case cost of finding records satisfying 10 < a < 50 using this index, in terms of the number of records n1, retrieved and the height h of the tree? 2. what is the worst-case cost of finding records satisfying 10 < a < 50 and 5 < b < 10 using this index, in terms of the number of records n2 that satisfy this selection, as well as n1 and h defined above? 3. under what conditions on n1 and n2, would the index be an efficient way of finding records satisfying the condition from part (2)?
Answers: 1
question
Computers and Technology, 24.06.2019 07:50
Write a defining table and then a program that determines if you can sleep in or not. your program should get all its input from your computer’s clock. on all weekdays (monday through friday) that are not holidays, your program should output “get up! ” on all other days (weekends and holidays), your program should output “sleep in.” the three holidays that your program must check for are january 1 (new year’s day), july 4 (u.s. independence day), and december 25 (christmas). you don’t need to include other holidays in your program because most other holidays do not occur on a fixed day each year.
Answers: 1
question
Computers and Technology, 24.06.2019 10:50
In 2009 to 2010, how many social network users were reported as being victims of online abuse? a. 1 in 10 b. 100% c.1 in 100 d. 50%
Answers: 2
question
Computers and Technology, 24.06.2019 13:20
In the insert table dialog box, you select the checkbox to create the first row as the header of the table.
Answers: 3
You know the right answer?
Stringset yet again

attached files:

file stringsetguiframes. zip (86.121...
Questions
question
English, 12.03.2020 05:02
question
Mathematics, 12.03.2020 05:02
question
Mathematics, 12.03.2020 05:02