Ok, I'm trying to transfer a string to an array so i can use each character separatly. I think I've managed that, now I want to output the contents of an array. However, Ive only managed to output the first character of the string.
This is the code I use to transfer string to array:
and this is the code that outputs it to the applet:
I'm guessing te problem is somewhere in here, but I can't think for the life of me where.(bit of a noobie!)
If it helps I can post the rest of the code, its not big at all.
Maybe the real question here isn't about the array but what you are doing with it -- why are you using Graphics method drawChars instead of drawString or java.awt.font.TextLayout? Advancing by character width will not take into account things like kerning which make text layout more pleasing to the eye.
Note also that in those first three lines of code, only the last really does anything -- the char you allocate with "new" is discarded and replaced by a new one that you get from calling toCharArray(). There's no need to do the first allocation at all.
im using draw.char because i want to be able to eventually change each character separatly before printing them out collectively, basicallly im trying to write an vigenere encryption applet
Joined: Sep 16, 2005
Originally posted by peter huff: im using draw.char because i want to be able to eventually change each character separatly before printing them out collectively, basicallly im trying to write an vigenere encryption applet
That encryption may lead you to using a String's charAt() method as well as StringBuffer to be a mutable string, but I don't see why you have to use a char array or drawChar.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com