From: Ruben M. <ru...@un...> - 2001-10-06 17:18:27
|
hi, >I would recommend implementing a special text-input component that >writes its input into a dynamically allocated char array. KeyStore >expects its input as a char-Array and the array can be overwritten >with 0 after usage. You can do that by hooking into the Keyboard >event processing, check out JTextComponent. problem is: if i use JTextArea (or JTextComponent) - i could override processKeyEvent() - i would still have to display it somehow. if i used setText() for that and have the Component display the text, i'd have to instantiate a String to use as parameter, plus i couldn't be sure how it is handled internally. so, basically, i'd have to extend Canvas or something, keep a char[] internally and draw the letters myself (one by one). but i'd still have the single letters as Strings (which shouldn't be that much of a problem). >Another issue is about the method naming. I would recommend following >the Java Beans naming guidelines as that will make the component >easier to use in GUI builders. For example, instead of "hideTyping" >and "checkHideTyping" you would provide "setHideTyping(boolean)" and >"isHideTyping" (or maybe correct the grammar ;-) Check out the >JavaBeans introduction (can be found in the JDK documentation) for >more information. those are private, dammit :) but i've changed them, anyway. .rm |