Re: increment letters



On Tue, 31 Jul 2007 20:16:37 +0000, Twisted wrote:

On Jul 31, 4:03 pm, glennsno...@xxxxxxxxxxx wrote:
this.add(new JButton("A"));

Try

add(new JButton(""+'A'+i));

This works in C; less sure about Java. There's also:

The correct form is add(new JButton(""+(char)('A'+i)));

What you wrote would (I think) give you "A0","A1", etc.
.


Quantcast