File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"add" method

 
Candy Bortniker
Ranch Hand
Posts: 123
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic