I’m trying to put the alphabet in different buttons, but I cant make it work. My code looks like this:
char[] Letter = {'a','b','c','d','e','f','g','h'
,'i','j','k','l','m','n','o','p','q'
,'r','s','t','u','v','w','x','y','z'};
Button[] But;
for (int i = 0; i <= 26; ++i) {
But = new Button(Letter[i]);
this.add(But[i], BorderLayout.SOUTH);
}
This should work for you. Its convention in Java to name variables starting with a lower case letter.