aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark ""add" method" Watch ""add" method" New topic
Author

"add" method

Candy Bortniker
Ranch Hand

Joined: Mar 17, 2003
Posts: 123
I have a program that is suppose to allow the user to press enter to move to the next textfield. My instructor says I need a "add" method that will put a listener into the vector. My problem is that I don't know really how to write this statement. There is a lot of code to this and I'm not sure how much you need to see to give me any help.
This is in LimitedTextContainer:

Here is the driver program:
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

If I understand what you are saying you will need something like...

Then calling this somewhere in your code would be

Without knowing what Listener needs added and to what Vector I took a guess at the Vector and made up a Listener name. I think the point your instructor is trying to make is code re-use. So instead of issuing the Vector's add() method whenever you need it, you would just call a single function that would do the same thing. However, this seems like calling an extra method because a Vector already has an add() method. So it kind of me.
[ March 01, 2004: Message edited by: Gregg Bolinger ]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: "add" method
 
Similar Threads
making a class visible
Save information in SQL database using timer
need help with "=" error
help with understanding code
trying to add label